termux-app icon indicating copy to clipboard operation
termux-app copied to clipboard

With no menu button, I can't find a way to close a session

Open ghost opened this issue 7 years ago • 15 comments

Without having a menu button, I can't find a way to close a session in termux. There's "Exit" in the notification which terminates all sessions, and of course I can type "exit" but that only works if there's nothing blocking running in the terminal - but I can't find any way to close a single session while keeping the others open.

The most obvious way would be to add a close button to each entry of the sessions sidebar, but there doesn't appear to be any.

ghost avatar Nov 23 '18 14:11 ghost

Ctrl-d is not working ? Or you are experiencing https://github.com/termux/termux-app/issues/56 or https://github.com/termux/termux-app/issues/627 ? If these issues, then wait for next Termux version (fix in https://github.com/termux/termux-app/pull/793).

ghost avatar Nov 23 '18 14:11 ghost

There really should be a graphical close button. All terminals on the desktop have it as well.

Also, doesn't CTRL+D actually do something different in SSH sessions? (like, actually transmit that and process it server-side e.g. inside screen, instead of just closing the connection) But even if it doesn't, please add a close button. Not having one is just not very intuitive.

ghost avatar Nov 23 '18 14:11 ghost

Generally, Ctrl-d pressed in shell closes current shell process. So it doesn't kill entire Termux session.

graphical close button

There already a Kill process button that will kill Termux session. Just long tap somewhere and menu will appear.

screenshot_20181123-163713_termux

But I think that it will be better to rename it, for example, to Kill session.

ghost avatar Nov 23 '18 14:11 ghost

Ok, yeah, that name would sound a lot more clear. However, it's still a bit hidden - why not put a close button on the side drawer? It works like a tab bar in most apps really, so I'm quite sure that's where a lot of people will look first if they ever use more than one session and want to stop just one of them

ghost avatar Nov 23 '18 15:11 ghost

It is possible to put a button to the drawer. But it will be hidden for some users anyway as only wiki mentions about existence of drawer. The same goes for 'menu'.

ghost avatar Nov 23 '18 15:11 ghost

That is okay though, because everyone opening more than one session will notice the drawer exists I think. And for the others, the notifications "Exit" works just fine since they don't have more than one session open anyway

ghost avatar Nov 23 '18 15:11 ghost

@xeffyr I also noticed recently that the menu on Android devices without hardware menu button is only available through the long-press select popup > "More...", but the long-press popup disappears instantly for me when the text changes (e.g. scrolling further in a screen). This makes the menu effectively inaccessible for sessions with things going on, which means there really should be another way of closing the current tab. Just adds IMHO another good reason to just add a close symbol to the tab bar on the left

ghost avatar Dec 02 '18 19:12 ghost

CTRL d works

Emex4gman avatar Aug 23 '19 14:08 Emex4gman

@Emex4gman as mentioned above CTRL d I'm relatively sure does not work in some places like screen because it's a transmitted terminal thing, and e.g. might close the screen session instead (which is not the same as closing the local terminal)

ghost avatar Aug 23 '19 15:08 ghost

@Emex4gman as mentioned above CTRL d I'm relatively sure does not work in some places like screen because it's a transmitted terminal thing, and e.g. might close the screen session instead (which is not the same as closing the local terminal)

It works for me though https://youtu.be/ll3YD4JRtIo

Emex4gman avatar Aug 23 '19 15:08 Emex4gman

What works for you? You don't appear to be using a remote screen session via ssh, so I don't understand how what you linked is in any way relevant

Also, in any case, a close button that is less hard to find would still be a cool addition (at least IMHO)

ghost avatar Aug 23 '19 17:08 ghost

the lack of such button doesn't bother me at all, but you could code it in yourself very easily using https://wiki.termux.com/wiki/Terminal_Settings

and a setting like this:

{macro: "CTRL d", display: exit}

cauerego avatar Oct 10 '20 08:10 cauerego

I'm relatively sure does not work in some places like screen because it's a transmitted terminal thing, and e.g. might close the screen session instead

Friend, if you aren't aware of what you are talking about, why are you suggesting it?

Terminal multiplexer such as screen and tmux have been used for years and use double-combos to avoid clashing with shell key combinations (ergo, Ctrl-b + Ctrl-_). All of these shortcuts were written with the terminal combinations in mind because before there were desktop environments and GUIs, people also had to close and leave their terminal sessions.

I've been using Termux for years and this fact has never bothered me, and seems like you need to get used to a CLI, where there is no GUI close button

On your good old bash shell:

  • Ctrl-d - send EOF signal (can you please close?)
  • Ctrl-c - send interrupt signal (I told you to close immediately)
  • Ctrl-z - send process to the background (same as appending & at the end of the command), it minimizes the process giving you a shell while the command runs on the background. Get the process back to foreground with the fg command

A GUI close button is not necessary.

EDIT

Tested screen in 2 mins, although it is taking Ctrl-d to quit screen, I have confirmed that SIGINT (Ctrl-c) still works to kill the on-going process or command, preserving the screen session.

You can also use SIGKILL (Ctrl-\) inside screen.

zalgonoise avatar Oct 16 '20 01:10 zalgonoise

the lack of such button doesn't bother me at all, but you could code it in yourself very easily using https://wiki.termux.com/wiki/Terminal_Settings

and a setting like this:

{macro: "CTRL d", display: exit}

is it possible to create new session without button like exit command . can we add ?

dedshit avatar Mar 18 '22 13:03 dedshit

@dedshit terribly worded good question. i don't think we can manage sessions with scripts in termux (but i don't know).

what i do myself, however, i have a button to display the session control window.

{macro: "DRAWER", display: tabs}

here i share my full unedited termux properties file which i find a perfect combo with freaking gboard...

extra-keys = [[ \
  {key: ESC, popup: {macro: "CTRL c", display: "ctrl c"}}, \
  {key: "?", popup: "|"}, \
  {key: "$", popup: "€"}, \
  {key: "~", popup: "^"}, \
  {key: "=", popup: "-"}, \
  {key: UP, popup: PGUP}, \
  {key: QUOTE, popup: APOSTROPHE}, \
  {key: KEYBOARD, popup: {macro: "CTRL d", display: exit}} \
],[ \
  {key: CTRL, popup: {macro: "CTRL ALT UP", display: "tx ←"}}, \
  {key: TAB, popup: {macro: "DRAWER", display: tabs}}, \
  {key: ":", popup: "#"}, \
  {key: "/", popup: BACKSLASH}, \
  {key: LEFT, popup: HOME}, \
  {key: DOWN, popup: PGDN}, \
  {key: RIGHT, popup: END}, \
  {key: ALT, popup: {macro: "CTRL ALT DOWN", display: "tx →"}} \
]]
// extra-keys = []
ctrl-space-workaround = true

but i want to migrate away into the "unexpected keyboard" soon enough.

cauerego avatar Mar 19 '22 08:03 cauerego