Essentially I just want to press Ctrl+Tab, not Ctrl+A then Tab. I don't believe this can be accomplished with an alias, but have read some stuff about maybe using stty? But I've never used stty and not sure how this would be done.
- 333,661
3 Answers
Yes, but only with the cooperation of your terminal emulator. Terminal emulators send escape sequences (or in a few cases a single control character) to indicate the press of a function key. See the “terminal — input” section of How do keyboard input and text output work? for more details. You need to configure your terminal to send a unique escape sequence for Ctrl+Tab. Some terminals send the Tab character for both plain Tab and Ctrl+Tab, so that applications can't distinguish between them. To see what your terminal sends, press Ctrl+V then Ctrl+Tab. If you see a few spaces, that's bad and you need to reconfigure your terminal, if possible. How to do that depends entirely on the terminal software. If you see something like ^[O5 (escape, O, 5), that's fine.
Assuming that your terminal sends a unique escape sequence for Ctrl+Tab, you can tell Screen what to do with it with the command bindkey. (It's bind for bindings that start with the “Screen key” Ctrl+A, and bindkey for other key bindings). For example, with the control sequence above, put the following line in your .screenrc:
bindkey ^[O5 next
- 829,060
-
It does give me a space when pressing Ctrl + V then Ctrl + Tab. But i'm finding out that "screen" is a command i'm not liking, and am searching for something else to help me partition one terminal in half into two. – Adam Farnsworth Oct 30 '18 at 16:53
If you are using xterm, add this to your ~/.Xresources file:
*vt100.translations: #override \n\
Ctrl ~Shift <Key>Tab: string(0x1b) string("[27;5;9~") \n \
Ctrl Shift <Key>Tab: string(0x1b) string("[27;6;9~") \n
This goes in your screenrc configuration file:
bindkey "^[[27;5;9~" focus
Make sure to log out of your X session.
- 540
-
4
xrdb -merge ~/.Xresourcescan be used to merge in the changes to the existing session so the nextxtermwill pick up the changes. – Stephen Harris Oct 26 '18 at 18:18
- 14,546
- 1
- 27
- 39
-
1This is assuming that the user runs some sort of desktop environment (or at least X11), right? This is very likely, but not universal (I don't, for example). – Kusalananda Oct 26 '18 at 18:15
-
This would make it impossible to use Ctrl+Tab normally in other applications. – Gilles 'SO- stop being evil' Oct 26 '18 at 18:32
gnu-screen. Do you mean switching between GNUscreenwindows in a terminal? – Kusalananda Oct 26 '18 at 17:45screenin an X11 environment like Gnome or KDE or similar desktop manager? – Kusalananda Oct 26 '18 at 18:19putty) or some other method? – Stephen Harris Oct 26 '18 at 18:19https://stackoverflow.com/questions/614785/bash-how-to-use-screen-to-have-a-term-session-used-at-home-after-work
Although something that I dont like about this is that you cant scroll up the different sessions, it only allows you to scroll up both at the same time. What do you guys use to partition your terminals in half?
– Adam Farnsworth Oct 30 '18 at 16:51