termux / termux-app

Termux - a terminal emulator application for Android OS extendible by variety of packages.
https://f-droid.org/en/packages/com.termux
Other
31.26k stars 3.32k forks source link

[Feature]: Switch session by keyboard #3915

Closed Freed-Wu closed 1 month ago

Freed-Wu commented 1 month ago

Feature description

Currently, we switch session by:

  1. swipe right on the left side of termux app
  2. press the session

New session by:

  1. swipe right on the left side of termux app
  2. press new session

Can we customize a hotkey to do these work? Such as <Volumn UP> + one key, or <C-S-T to create new session, <C-S-W> to close new session, <C-S-P> to switch to previous session ....

Additional information

If we can customized hotkey to manage session, It looks like a terminal emulator of PC :smile:

agnostic-apollo commented 1 month ago

https://wiki.termux.com/wiki/Terminal_Settings#Handling_terminal_sessions

Freed-Wu commented 1 month ago

It looks like some hotkey cannot be used: <C-S-T>, <C-Tab>, Super + T ...

The allowed keys are what?

Freed-Wu commented 1 month ago

https://wiki.termux.com/wiki/Hardware_Keyboard

Looks only Ctrl + Alt + X is legal?

Freed-Wu commented 1 month ago

Can I use Ctrl + Shift as prefix? It can make I use same hotkey of my PC's terminal emulator.

agnostic-apollo commented 1 month ago

Software and hardware keyboard shortcuts are different, hence different wiki pages, do not mix them.

For soft, only ctrl+x can be used IIRC, not ctrl+alt+x or other combos.

Freed-Wu commented 1 month ago

Or, that is only ctrl+X can be set in ~/.termux/termux.properties for shortcut, (soft) and ctrl+alt is hard encoded as a prefix for ctrl+alt+c, ctrl+alt+r, (hard)... Right?

ctrl+X will override the hotkey of terminal programs (bash, vim, ...), I think allow user use ctrl+shift+X will be better?

And can the prefix ctrl+alt of hard to be changed to other prefix such as ctrl+shift? And can we change the hotkey of hard, such as use prefix + t not prefix + c to create a new session?