Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can’t use Alt/Meta #28

Closed
towolf opened this issue Sep 15, 2012 · 8 comments
Closed

Can’t use Alt/Meta #28

towolf opened this issue Sep 15, 2012 · 8 comments
Assignees
Labels

Comments

@towolf
Copy link

towolf commented Sep 15, 2012

Not sure if that has anything to do with termcap, but I cannot use things like <Alt>Period or <Alt>Backspace

@dvdhrm
Copy link
Owner

dvdhrm commented Sep 15, 2012

Could you elaborate this a bit more? Do you want to use these as --grab-XY= or do they have special bindings in other terminals? Or do you want to use them in SSH as special keys? I'm not following, sorry.

@etam
Copy link

etam commented Sep 15, 2012

My use-case: In Midnight Commander there are lots of commands like <Alt>i or <Shift>F3. When I'm trying to use them, it behaves like I was just pressing i or F3.

@dvdhrm
Copy link
Owner

dvdhrm commented Sep 15, 2012

Indeed, xterm generates '\302\210' on alt+backspace. Hm, I haven't found anything about that in the vt220 specs. I will have a look how these are handled by xterm and Co.

@towolf
Copy link
Author

towolf commented Sep 15, 2012

Well for me it’s specific inputrc bindings like

"\e\C-h": backward-kill-word
"\e*": insert-completions
"\e.": yank-last-arg

check bind -p for these ...

@dvdhrm
Copy link
Owner

dvdhrm commented Sep 16, 2012

Currently the problem is that kmscon ignores the ALT/MOD1 key entirely. That is, the bash doesn't even know whether it was pressed or not.

http://invisible-island.net/xterm/ctlseqs/ctlseqs.html
This tries to explain the ALT/META keys but I haven't quite understood it yet. It doesn't seem to be the behavior my bash shows.

http://www.vt100.net/docs/vt510-rm/chapter8
This also does not mention the ALT key for normal keys.

Hm, sorry that i cannot fix this right away. I will have to look into this again this week. Thanks for the fast responses!
(Or maybe I am really missing something obvious here?)
David

@ghost ghost assigned dvdhrm Sep 16, 2012
@bluetech
Copy link
Contributor

I can confirm this, in almost all terminal emulators I know (well except xterm) meta should should send \033 (escape) before the key. xterm has a config for that called metaSendsEscape (see the ctrlseqs file you linked to), and as I said it's the default almost everywhere. A quick test if it works is ALT-b to back a word, and ALT-f to forward a word, which should work in every readline application (e.g. bash).

@bluetech
Copy link
Contributor

And btw, the mod to use for this is UTERM_MOD1_MASK.

@dvdhrm
Copy link
Owner

dvdhrm commented Sep 16, 2012

I've pushed a fix to the repository:
8deb82f

Thanks a lot for the fast responses. It still bothers me that XTerm disables altSendsEscape by default and uses the 128-shift instead. However, if the other terminals enable it by default, it is probably the best to do this in kmscon, too. (I also don't see any reason why that 128-shift should be any useful).

If there are any more issues with this, you can reopen it. Thanks!
David

@dvdhrm dvdhrm closed this as completed Sep 16, 2012
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants