Enter and backspace broken in terminal

Bug #1257791 reported by Alan Pope 🍺🐧🐱 🦄 on 2013-12-04
This bug affects 36 people
Affects Status Importance Assigned to Milestone
Ubuntu Terminal App
Łukasz Zemczak
qtdeclarative-opensource-src (Ubuntu)
Daniel d'Andrada
ubuntu-ui-toolkit (Ubuntu)

Bug Description

Open terminal on #47 on mako
type ls then press enter
Observe enter key no longer functions.
Try to backspace
Observe backspace key no longer functions.

Related branches

Oliver Grawert (ogra) wrote :

confirming ... the graphics of both keys seem to indicate they are constantly pressed down btw

Changed in ubuntu-terminal-app:
status: New → Confirmed
tags: added: avengers regression
Robert Bruce Park (robru) wrote :

The thing about the buttons looking pressed is unrelated i think; i just tested this in image #46 and the return/backspace keys look pressed but work fine.

Nicholas Skaggs (nskaggs) wrote :

This is wicked.. Confirming here on image #56

Changed in ubuntu-terminal-app:
importance: Undecided → Critical
importance: Critical → High
Changed in ubuntu-terminal-app:
importance: High → Critical
Ursula Junque (ursinha) wrote :

I can confirm this bug on mako r50.

Jamie Strandboge (jdstrand) wrote :

I can confirm this on mako r58.

Jamie Strandboge (jdstrand) wrote :

This is a rather serious regression for me-- the bug just got into promoted images and now I can't access mail (I use mutt on the device). It also makes troubleshooting other parts of the stack difficult if you don't want to/can't use adb shell at the time you are troubleshooting.

Jamie Strandboge (jdstrand) wrote :

It was believed that the bug was introduced in the latest terminal app. Older versions of the app can be found here:

0.5.29 (introduced Dec 12), 0.5.28 (introduced Nov 18) and 0.5.27 (introduced Nov 5) are all broken which makes me believe that a change in the platform introduced this bug.

To install an older click as phablet user:
$ click list
com.ubuntu.terminal 0.5.29

$ pkcon install-local /tmp/com.ubuntu.terminal_0.5.28_armhf.click
$ click list
com.ubuntu.terminal 0.5.28

After launching the terminal app, I verified that the correct version was running:
$ sudo aa-status
   com.ubuntu.terminal_terminal_0.5.28 (18108)
   com.ubuntu.terminal_terminal_0.5.28 (18132)

(the last two indicate that PIDs 18108 and 18132 are running under the com.ubuntu.terminal_terminal_0.5.28 profile, which can only happen with the 0.5.28 app).

Jamie Strandboge (jdstrand) wrote :

Oh, I forgot to mention-- if you want to uninstall the older version:

$ pkcon remove 'com.ubuntu.terminal;0.5.28;armhf;local:click'
$ click list
com.ubuntu.terminal 0.5.29

Sergio Schvezov (sergiusens) wrote :

One small comment, due to historical reasons, the sync syncs all packages in the list; so the previous version's date stamp is a better indicator of when it was last used and the new version introduced.

Better yet, use the image changelog or the store's history.

Sync will be fixed soon though and introduction date will mostly map with the apache timestamp.

Jamie Strandboge (jdstrand) wrote :

From IRC:
09:37 < sergiusens> jdstrand, didrocks in a nutshell, the terminal app has been
                    used (same version), since "New version: 0.5.29 on
                    2013-11-18 15:36 - 3 weeks, 3 days ago"

Point stands-- none of the last 3 versions of terminal app work now, but terminal app used to work in the previously promoted image from November.

Jamie Strandboge (jdstrand) wrote :

I suggest a future test case drives the keyboard to enter a command into the terminal and check the result. The command could be 'touch /tmp/test-lp1257791' and then the check is if the file exists.

Nicholas Skaggs (nskaggs) wrote :

Jamie, we'd considered a test like this, apparently it is needed. I'll open one now to track. So if this is an underlying platform issue, I guess we're going to end up flashing images until we see when the regression was introduced. Any guesses as to what components could cause such a regression? I'll start with when the keyboard got changed :-)

Jamie Strandboge (jdstrand) wrote :

My guesses are just that, but I personally would start looking at ubuntu-keyboard, qtubuntu, maliit and mir.

Florian W. (florian-will) wrote :

I'm on an older image (20131209.1, AKA trusty 55) and an unsupported device, but here are two more observations:

* Fails to work regardless of /home/phablet/.display-mir existence (i.e. confirming bug using either Mir or surfaceflinger on r55)
* Even though the keyboard button has a "pressed down" look, it still changes its appearance slightly when I hit the enter key

Nicholas Skaggs (nskaggs) wrote :

Whoa -- even image 55 doesn't work. Gotta keep going back in time I guess.

Victor Thompson (vthompson) wrote :

I added some debug and hitting the enter and backspace keys do not even trigger the plugin's termKeyPressed signal.

Victor Thompson (vthompson) wrote :

I've associated a work around branch that adds BACKSPACE and ENTER buttons to the "Text ctrl keys" panel. The terminal is completely unusable without having the ability to hit Enter.

akI (azeone123) wrote :

Just wanted to confirm this as well im on r79 at the moment.

Lars Hagström (donoregano) wrote :

External USB keyboard does not work in the terminal app either. No keys at all work. The keyboard works in Notes, so it is connected correctly.
Don't know if this is related, or a different bug.

mhb (hexed) wrote :

you can write a simple app and execute it first hand with ~/.bashrc and have it use Ctrl+C instead of enter but you can't use sudo ...
@vthompson : can you share how you did that ? it doesn't look like terminal's going to be fixed any time soon
(same on trusty r108)

Victor Thompson (vthompson) wrote :

@mhb, you should be able to do the following with the phone connected to your computer (you can skip the first step if your image is already writeable):

adb shell touch /userdata/.writable_image && adb reboot

After phone reboots execute the following:

wget http://bazaar.launchpad.net/~vthompson/ubuntu-terminal-app/backspace-and-enter-workaround/download/head:/scrlkeys.qml-20130506190234-93itbo4vrf9j05mi-5/ScrlKeys.qml && adb push ScrlKeys.qml /usr/share/click/preinstalled/com.ubuntu.terminal/current/extraPanel/

The "Text ctrl keys" panel should now have a BACKSPACE and ENTER button--however the text will be fairly unreadable (that's another issue).

David Planella (dpm) on 2014-01-07
Changed in ubuntu-terminal-app:
status: Confirmed → Triaged
mhb (hexed) wrote :

@Victor: i now see what you're saying about not being able to read the text :} so i used your method to add it to the circle panel
push this to /usr/share/click/preinstalled/com.ubuntu.terminal/current . it works for enter but really wastes time if you want to spam backspace
Terminal.qml : http://d-h.st/u62

Victor Thompson (vthompson) wrote :

@mhb, the text size is an issue that was just fixed a few minutes ago when another branch was merged [1]. The work around will be updated a bit later today (7 or 8 hours from now) with similar changes.

[1] https://code.launchpad.net/~vthompson/ubuntu-terminal-app/fixes-1260903-button-text-size-color/+merge/199015

mhb (hexed) wrote :

sorry i thought you meant that when using that panel for enter/backspace the there's not enough room left for text (terminal's text). thanks though will update asap

Jamie Strandboge (jdstrand) wrote :

Do we still not have any idea why the terminal broke in the first place? (and why the workarounds are needed)

Nicholas Skaggs (nskaggs) wrote :

I'm still attempting to discover why terminal broke in the first place; I'm hesitant to merge a workaround at this time.

Victor Thompson (vthompson) wrote :

Someone needs to look at both what key events are being generated by the OSK and why they are not being recognized by the Terminal's plugin (see my comment #16). I did some quick looking at what the OSK people when I wrote the comment and it seemed like maybe some of the changes were driven by predictive text features.

Nicholas Skaggs (nskaggs) wrote :

This definitely works in saucy, confirmed again. So I'm looking at the diff between saucy and trusty versions of ubuntu-keyboard, etc.

Jamie Strandboge (jdstrand) wrote :

Oh, if its predictive text, could someone specify Qt.ImhNoPredictiveText (or similar)? Predictive text seems plausible since it wasn't in saucy aiui. I think there might be a way to disable it globally to test the theory, but I don't know otoh.

Nicholas Skaggs (nskaggs) wrote :

Predictive text is still off, you can disable it like so if you wish:

gsettings set com.canonical.keyboard.maliit predictive-text false

Here's some other fun settings.

gsettings set com.canonical.keyboard.maliit auto-capitalization false
gsettings set com.canonical.keyboard.maliit auto-completion false
gsettings set com.canonical.keyboard.maliit key-press-feedback false
gsettings set com.canonical.keyboard.maliit spell-checking false

Best I can tell ATM, the move from pinyin2 to pinyin4 is when/where it happened. That was late November. Trying to track things down a bit further to confirm.

Nicholas Skaggs (nskaggs) wrote :

Perhaps the fix for this is the root case?


Changed in ubuntu-keyboard:
status: New → Confirmed
Bill Filler (bfiller) wrote :

Am I correct that the ubuntu-terminal app has a dependency on konsole-qml-plugin source package from this PPA:

If so, wondering if a rebuild of that package against latest libraries in trusty might be helpful, especially if we suspect that the problem is related to the newer pinyin library. Looks like last build was on 10-30 which is quite old.

Without diving deeper, I'm suspecting that the problem/conflict must lie in that plugin as all other qml apps in the system work fine with the backspace and return key. Where exactly is the code that is refered to in comment 16?:

Need to understand the mechanism of how the OSK and plugin communicate and why only these specific keys no longer work. But lets try to rebuild the plugin first and see if that helps at all.

Bill Filler (bfiller) wrote :

one other unrelated comment, the text area used in the terminal display should disable auto-capitalization (and optionally predictive text) by setting appropriate inputMethodHints. Currently typing . followed by a space will trigger auto-cap of next word and that's not what you want in terminal.

Specifically you can set Qt.ImhNoAutoUppercase and/or Qt.ImhNoPredictiveText on the TextInput field to disable these per http://qt-project.org/doc/qt-5/qml-qtquick-textinput.html#inputMethodHints-prop

Nicholas Skaggs (nskaggs) wrote :

A new build of the konsole-qml-plugin is in the ppa. I've pushed the trunk version of terminal to my device and used this new build, but the situation is the same. Looking at the plugin however has me intrigued. The plugin has a few keymaps in it, and perhaps the answer might lie there. Sadly, my qml plugin skills aren't up to snuff -- anyone else able to have a look? Overall, we've narrowed the issue on the plugin I think.


Victor Thompson (vthompson) wrote :

@Bill, Nicholas, the code I referenced in comment #16 is the code Nicholas pointed out above in comment #36. I'm not sure the keytab file is the culprit because the termKeyPressed signal isn't even being fired for those key events.

Nicholas Skaggs (nskaggs) wrote :

The konsole plugin author doesn't have pc access atm, but should be able to look at this in about another week. I'm holding tight until then.

Victor Thompson (vthompson) wrote :

I think this might be an issue with the OSK and not something the plugin is doing wrong. I was able to get the app to recognize both the Backspace and Enter keys when predictive text was turned on (however I still could not execute commands). To see what I saw do the following:


1. adb shell

2. sudo -iu phablet gsettings set com.canonical.keyboard.maliit predictive-text true
(this turns on the predictive text feature of the OSK)

3. Apply the following patch to the Terminal app to view when the app sees keypresses (should be /usr/share/click/preinstalled/com.ubuntu.terminal/current/Terminal.qml):
=== modified file 'Terminal.qml'
--- Terminal.qml 2013-12-22 04:54:30 +0000
+++ Terminal.qml 2014-01-19 20:35:39 +0000
@@ -206,6 +205,10 @@
                     width: parent.width
                     height: parent.height

+ onKeyPressedSignal: {
+ console.log("KEY PRESSED")
+ }
                     session: KSession {
                         id: ksession
                         objectName: "ksession"

4. tail -f /home/phablet/.cache/upstart/application-click-com.ubuntu.terminal*.log


1. Start the Terminal app
2. Press Backspace and Enter keys and note that "KEY PRESSED" is not logged in output
3. Press "a" and note key is detected
4. Press "b" and note key is detected
5. Press Backspace and note key is detected
6. Press Enter and note key is detected
7. Press Backspace and Enter keys and note that the keys are once again NOT detected

I believe this proves that OSK is the reason for this behavior change.

Changed in ubuntu-keyboard:
assignee: nobody → Łukasz Zemczak (sil2100)
status: Confirmed → In Progress
Nicholas Skaggs (nskaggs) wrote :

Just adding some old notes on this so it doesn't get lost.

"The first build where this appears is the Nov 6th or 22nd release. Everything works under Saucy. I tried running some older builds to pin down where the issue lies, but dependencies (libpinyin2) make this difficult."

As of today, I believe popey has pure old builds that will make flashing these easier. I was trying to cobble together old terminal builds with the last saucy image. Look at the changelog to determine when libpinyin2 changed and entered the image and confirm that is the date terminal no longer works. Note, the change from saucy to trusty also happened around the same time. My guess is right around thanksgiving when it broke.

I flashed a phone to 20131202 and everything works (as per comment #2 from robru) then flashed 20131204 and it's broken. Tried rolling back libpinyin4:armhf from 0.9.93+repack1-1ubuntu1 to 0.9.93+repack1-1 (the only thing we could see different that was related) and it's still broken.

Ok, I think we have a culprit. I flashed my phone cleanly with 20131204 and downgraded only libqt5quick5 from https://launchpad.net/ubuntu/+source/qtdeclarative-opensource-src/5.0.2-6ubuntu4/+build/5094593/+files/libqt5quick5_5.0.2-6ubuntu4_armhf.deb and the backspace and enter key works okay again.

Changed in ubuntu-keyboard:
assignee: Łukasz Zemczak (sil2100) → nobody
Nicholas Skaggs (nskaggs) wrote :

Grinding through package after package with popey is fun. Kudos for having all those old builds :)

Nicholas Skaggs (nskaggs) wrote :

So in looking at what exactly changed between the versions; it's only a debian patchset change. Of the two changes, this looks the most interesting;


Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in ubuntu-ui-toolkit (Ubuntu):
status: New → Confirmed
Michał Sawicz (saviq) wrote :

Our own dandrader was the author of said patch for QTBUG https://bugreports.qt-project.org/browse/QTBUG-32004, if someone could assign him to the qtdeclarative task, I'm sure he'll have valuable input.

Michael Hall (mhall119) on 2014-02-02
Changed in qtdeclarative-opensource-src (Ubuntu):
assignee: nobody → Daniel d'Andrada (dandrader)
Changed in qtdeclarative-opensource-src (Ubuntu):
status: New → In Progress
Daniel d'Andrada (dandrader) wrote :

The patch I made to qtdeclarative makes all events (touch, keyboard, etc) reach QQuickItems through their QObject::event() methods. Before that QQuickWindow was calling QQuickItems internal event handlers directly (e.g. QQuickItemPrivate::handleTouchEvent(), etc).

Because of that it's important that you let your QQuickItems process the events it receives. But it seems that's not happening with KTerminalDisplay.

The patch I'm attaching should solve it.

NB: The only place where I found konsole-qml-plugin was ~hiroshidi/ubuntu-terminal-app/konsole-qml-plugin. But I'm not sure if this where its upstream lives as it conflicts with code in lp:ubuntu-terminal-app (Qml complains about use of unexisting properties from KTerminal and KSession). Thus I was unable to properly test my path

Changed in ubuntu-keyboard:
status: In Progress → Invalid
Changed in qtdeclarative-opensource-src (Ubuntu):
status: In Progress → Invalid
Changed in ubuntu-ui-toolkit (Ubuntu):
status: Confirmed → Invalid
Nicholas Skaggs (nskaggs) wrote :

I've built a deb using the patch here, for ease of testing.

Nicholas Skaggs (nskaggs) wrote :


Initial testing using the above deb seems to inidicate the issue isn't fixed sadly :-(

Victor Thompson (vthompson) wrote :

deb file appears to want to install the files to /usr/lib/arm-linux-gnueabihf/qt5/qml/ when it should go under the click package's installation directory. Patch works for me when I extract the files to the click installation directory.

With the patch, however, keypresses are doubled. So typing "df -h" will produce "ddff --hh". Enter and backspace do NOT appear to double.

Marietto (marietto2008) wrote :

I can confirm this bug in this version of ubuntu-touch on the nexus 10 :

root@ubuntu-phablet:/# uname -a
Linux ubuntu-phablet 3.4.0-4-manta #19-Ubuntu SMP PREEMPT Tue Oct 8 13:14:29 UTC 2013 armv7l armv7l armv7l GNU/Linux

Changed in ubuntu-terminal-app:
assignee: nobody → Łukasz Zemczak (sil2100)
status: Triaged → In Progress
Łukasz Zemczak (sil2100) wrote :

Fix ready for review. Thanks Daniel for the pointers!

Fix committed into lp:ubuntu-terminal-app/plugin at revision 14, scheduled for release in ubuntu-terminal-app, milestone Unknown

Changed in ubuntu-terminal-app:
status: In Progress → Fix Committed

Fix landed in the store today.

Changed in ubuntu-terminal-app:
status: Fix Committed → Fix Released

Sorry this is all new to me, does store mean that if I am dual booting I
could download the new version and it would work? Like after 194 (the
version I'm running)?

Joshua Chamberlain <http://14174593940.80808.co>

On Sun, Feb 23, 2014 at 2:02 PM, Alan Pope ㋛ <email address hidden> wrote:

> Fix landed in the store today.
> ** Changed in: ubuntu-terminal-app
> Status: Fix Committed => Fix Released
> --
> You received this bug notification because you are subscribed to the bug
> report.
> https://bugs.launchpad.net/bugs/1257791
> Title:
> Enter and backspace broken in terminal
> Status in Ubuntu Keyboard:
> Invalid
> Status in Terminal application for Ubuntu devices:
> Fix Released
> Status in “qtdeclarative-opensource-src” package in Ubuntu:
> Invalid
> Status in “ubuntu-ui-toolkit” package in Ubuntu:
> Invalid
> Bug description:
> Open terminal on #47 on mako
> type ls then press enter
> Observe enter key no longer functions.
> Try to backspace
> Observe backspace key no longer functions.
> To manage notifications about this bug go to:
> https://bugs.launchpad.net/ubuntu-keyboard/+bug/1257791/+subscriptions

It means the version of the app in the store is updated. If you have update manager installed it should install the update. Otherwise You could uninstall terminal app (from within ubuntu touch) and reinstall it and it should be updated to the new version.

my enter button is not working when i opened the terminal

Changed in ubuntu-keyboard:
status: Invalid → Opinion
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers