geodesic
geodesic copied to clipboard
Prevent accidentally killing first session if other sessions are open
Have a question? Please checkout our Slack Community or visit our Slack Archive.
Describe the Feature
I often will run multiple terminal sessions of the same geodesic container. If I ran a terraform command such as terraform apply
in sesson[1]
and then ran exit
in session[0]
, my session[1]
would terminate and leave me with a half applied terraform state.
Use Case
N/A
Describe Ideal Solution
If multiple sessions are open, prompt the user when they try to exit session[0]
.
$ exit
Detected additional sessions open
* /bin/bash : terraform apply
* etc
Are you sure you want to exit [y/N] ? N
exit prevented
$
Alternatives Considered
N/A
Additional Context
N/A
@nitrocode Do you have any suggestion as to how to implement this? You would have to trap/prevent exit
, logout
, and ctrl-D. I know you can set IGNOREEOF
to give a warning on ctrl-D, but I don't know how you would run a custom hook for it.