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

Option to restore sessions from widget

Open fornwall opened this issue 8 years ago • 5 comments

From @kokoko3k on March 2, 2017 9:54

Would it be possible, or maybe it already is, to restore opened sessions when tapping an entry on the widget, instead of launching a new one?

To be clear, -make an ssh shortcut to a remote server -start it -do not close/disconnect from it -start it again

You ends having 2 connections to the same server, i would like to have a way to choose the running one.

Copied from original issue: termux/termux-app#265

fornwall avatar Mar 04 '17 22:03 fornwall

A good idea. I wonder if this could be done always (for every shortcut launch), or if it needs opt in/out to allow multiple sessions for one shortcut? Opinions?

fornwall avatar Mar 04 '17 22:03 fornwall

I think That the widget could reflect the state of the current connection and allowing to restore the current one or just "raising" the last.

My idea of the widget:

Connection to server1 [+] (2)
Connection to server2 [+] (0)
Connection to server3 [+] (1)

Here the user configured connections to server1,server2 and server3 There are 2 sessions opened to server1, 0 sessions to server2 and 1 session open to server3. If the user taps the [+] next to "connection to server1], termux will spawn another connection to server1 if the user just taps to "connection to server1", termux will raise the last connection used to server1. If the user taps to "connection to server2" or the [+] next to it, termux will connect to server2 for the first time.

What do you think? Thanks for your attention.

kokoko3k avatar Mar 05 '17 16:03 kokoko3k

Meanwhile, i've had an idea. Is there an intent to bring a specific termux session to foreground or maybe a way to just check running sessions? One could use it in his scripts before spawning a new one.

kokoko3k avatar Mar 17 '17 12:03 kokoko3k

I would like to see this too, more so for things like nvim.

Sourdface avatar Nov 26 '23 01:11 Sourdface

This is supported in master of termux-app, but not in a released version yet. It's also a bit cumbersome to set up, but works fine. See https://github.com/termux/termux-app/commit/5794ab9a56f5a509f2c90ec2d96601254b680b8a and https://github.com/termux/termux-app/commit/d287734abae95107e73c763ccbd807315ca9a9c0

trygveaa avatar Feb 22 '24 17:02 trygveaa