Inability to use the Meta key in gnome-terminal (probably related to invoking the HUD?)

Bug #968688 reported by Jo Vermeulen
52
This bug affects 10 people
Affects Status Importance Assigned to Milestone
gnome-terminal (Ubuntu)
Confirmed
Undecided
Unassigned

Bug Description

When I'm using Bash in gnome-terminal, I'm currently unable to use the GNU Readline shortcuts to move forward a word, because pressing Left Alt + a key tries to open a menu option. For example, Alt+f opens the file menu. For some reason, the Alt key is bound to the menubar here.

Expected behavior: Alt+f moves the cursor forward one word
Current behavior: Alt+f opens the file menu.

The strange thing is that it does work in a GUI version of Emacs, but not when Emacs is run directly in the terminal (emacs23-nox). It also works correctly in xterm (after Ctrl + left-click > select "Meta Sends Escape"). So I'm not sure if it's a bug in gnome-terminal or in unity.

When you hold the Alt key in Emacs or xterm, nothing happens, the HUD is only displayed when you release the key again. Of course, when you're using it as a meta key, you're never doing that, you're holding it and combining it with another key. So that's the correct behaviour. In gnome-terminal, however, holding the Alt key doesn't do anything. It seems to be the case that combinations using the Alt key are interpreted as shortcuts for the menubar in gnome-terminal.

On a related note, I'm wondering whether binding Alt to the HUD won't conflict with the usage of Alt as a meta key? While Alt is the obvious choice (and I like the concept of the HUD), it would be very annoying to be unable to use the meta key in certain programs.

Jo Vermeulen (jozilla)
description: updated
description: updated
description: updated
Revision history for this message
Launchpad Janitor (janitor) wrote :

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

Changed in unity (Ubuntu):
status: New → Confirmed
Revision history for this message
Jussi Brunberg (jussi-brunberg) wrote :

I found that as a workaround you can disable menu access keys from Keyboard Shortcuts in Edit menu.

Revision history for this message
Edward Donovan (edward.donovan) wrote :

I don't think there's an Ubuntu bug here. You could take it up as a Gnome design debate; I wouldn't be surprised if that's been hashed over a few times.

gnome-terminal's default behavior is to steal the Alt key, for menu accelerators. Users like us who want to use the full readline bindings have to go to Edit->Keyboard Shortcuts, and uncheck 'Enable Menu Access Keys'.

As for your comment about the HUD, that's not how the HUD uses Alt; perhaps you've seen this, in the interim. It's activated by a short tap of the Alt key alone. Any use of Alt as a modifier for another key is meant to be unaffected. (Right now in Quantal, the HUD is being triggered by one of those situations, though the keybinding still succeeds. That's bug 969039, "HUD appears when tapping Alt+Left very quickly". Any interference like that will be treated as a bug.

Thanks.

Changed in unity (Ubuntu):
status: Confirmed → Invalid
Revision history for this message
Edward Donovan (edward.donovan) wrote :

(Launchpad let me change the status of the bug, but it's having a problem when I try to change the assignment to gnome-terminal,right now.)

I could add, if you couldn't find this preference, you could talk to upstream Gnome about how you might have discovered it more readily. Thanks.

affects: unity (Ubuntu) → gnome-terminal (Ubuntu)
Revision history for this message
Jo Vermeulen (jozilla) wrote :

@Edward: Thanks for the tip, that works for me!

Revision history for this message
Edward Donovan (edward.donovan) wrote :

Great! That drove me crazy until I found the option. I guess was looking under Preferences, not Keyboard Shortcuts. It sure could be easier to find. But I guess I'm not going to make an argument to upstream, 'cause I don't have a clear idea what would be best.

Glad to help. :)

Revision history for this message
v17al (mattdentremont) wrote :

Reopening this issue.

In 13.04, disabling menu access keys from Keyboard Shortcuts does not resolve this issue.

It appears that alt+key generates escape+alt+key,

Changed in gnome-terminal (Ubuntu):
status: Invalid → New
Revision history for this message
Launchpad Janitor (janitor) wrote :

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

Changed in gnome-terminal (Ubuntu):
status: New → Confirmed
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.