Sample Header Ad - 728x90

linux (gnu-) screen: remap Ctrl-a (default command key) to Alt-a in 'one go'

2 votes
1 answer
1901 views
Looking for a way to remap screens C-a or ^a (default command) binding, to Alt-a or ^[a by using an easy to memorize, one-go command / switch. I know this can be possible in 2 steps, but also only from screen itself - however, ideally I'd like to pass some parameter(s) to screens command line, when firing it up. What I'm looking for is something similar to Tmuxs command set prefix M-a (or rather somethin similar, since afaik screen doesn't understand such human-friendly syntax for Alt/Meta key). It would be even better if I could remap this default ^a to AltGr-a Tried following:
1. $ screen  -e '\0033''\0141'
Values of those were taken from showkey: ``` $ # showkey -a Press any keys - Ctrl-D will terminate this program ^A 1 0001 0x01 Command: bindkey [opts] [**string** [cmd args]] > > The argument ‘**string**’ is the sequence of characters to which an action > is bound. This can either be a fixed string or a **termcap** keyboard > capability name (selectable with the ‘-k’ option). The problem is where to find the 'Termcap' entry for Alt / AltGr key. man termcap shows nothing. Also, maybe this SE answer would be helpful, but I haven't been able to figure out the right syntax ------------------------------ For those suggesting to switch to Tmux instead: - I have to ssh on many different servers and its default keybindings are awkward to me, including changing windows, lack of C-b C-b jumping back to previous one (one has to use C-b l for this); - no session locking - my screen "muscle memory" - and a few others issues, which I'll remember if need be ;) **Even remapping** AltGr Ctrl would be a good enough solution provided it doesn't involve any X-related programs, since the servers are X free (non X-polluted).
Asked by cg79 (21 rep)
Apr 26, 2022, 03:50 PM
Last activity: Oct 27, 2022, 06:12 AM