Closed LoganDark closed 7 years ago
This is expected, as well as ssh does. You may use tools like nohup
to keep process running in background.
nohup makes my docker process stay alive after ttyd ends. and then I have to kill it manually, how do I fix this?
ttyd just kills the process when the browser closes, I want it to stay open after the webpage closes but I still want it to close when I kill ttyd.
Not support, this seems not the use scene of ttyd.
I mean like where I can visit the webpage at any time and have access to the running process
I want it to stay open after the webpage closes but I still want it to close when I kill ttyd
This is not possible, ttyd always send quit signal to process when client disconnected. if you want to share one terminal with multiple users, you can use a terminal multiplexer like tmux, for example: ttyd tmux new -A -s ttyd vim
.
nope, not what I want. what I want is a session I can always connect to in the browser. i'm not going to be sharing it with others.
sorry if i'm bothering you, but you don't seem to understand what I want
I Understood, but it is not possible for ttyd right now, so I gave you some workarounds.
What you want is something like tmux session managed by ttyd which maps connect
to attach
, disconnect
to detach
?
can't you just add like a --nokill
option, something likeDoesn't shut down process on client disconnect
?
i'd add that option myself but i have no idea how :/
No. ttyd doesn't store session, if it Doesn't shut down process on client disconnect
, that process will be stale, we can't identify which client it belongs to.
I give up...
Would it be possible to put an (Nginx) proxy in front which always keeps the connection alive and accepts coming and going connections and transfers these to the same session? For the ttyd
it would just seem that there is one long-running connection. Anyone got experience with this?
I am looking for same functionality. I need to keep the session running and access whenever I need to, using browser. I appreciate if there are any updates or ideas? Many thanks
I agree with the maintainer, this feature doesn't really make sense to handle in ttyd. It can be done with tools designed for running persistent sessions:
# start some persistent background terminal session (could also use tmux, Docker, etc)
screen -dmS htop-session htop
# attach to it when users connect to ttyd
ttyd bash -c 'screen -r htop-session'
I also agree with the maintainer and many thanks for the solution @dmartin In case somebody needs it, here I am leaving a link to my image
How do I stop this? (Even if it is not a bug)