Closed magicant closed 8 years ago
I think this should be the default, and a desk exit
command should be supplied instead of expecting the newly spawned shell process to be closed. It seems more intuitive to the user, and would prevent desk nesting, which doesn't seem desirable.
Thanks for the PR!
When testing locally, this doesn't seem to prevent desk nesting (which I agree can be annoying):
(venv) [Tue 24 22:56] job/code/desk pr-67*
$ desk go scruffy
(venv) [Tue 24 22:56] job/counsyl/scruffy master scruffy
$ desk go charon
(venv) [Tue 24 22:57] job/counsyl/charon master* charon
$ exit
(venv) [Tue 24 22:57] job/counsyl/scruffy master scruffy
$ exit
I haven't looked into why this might be yet... any ideas?
Thanks for testing my PR!
There are 3 shell instances involved here:
desk
commanddesk
scriptThis PR is to remove shell 2 because it is just unnecessary once shell 3 has been started. Since shell 1 is still alive, you can still exit from shell 3 and go back to shell 1.
Removing shell 1 as well would be a difficult job, as suggested in #36. I don't have a good idea on it.
Sounds good to me. This looks like a great change -- thanks for contributing. Let's merge!
By using "exec", the shell instance that is running the
desk
script is replaced by the new child shell. This will enable the original shell that invokeddesk
to take care of the child if the user suspends the child by typingsuspend
inside the desk.