Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

channel: Implement new escape sequence #70

Merged
merged 4 commits into from
Jul 13, 2022
Merged

channel: Implement new escape sequence #70

merged 4 commits into from
Jul 13, 2022

Conversation

Rahix
Copy link
Owner

@Rahix Rahix commented Jul 12, 2022

Let's follow systemd and use "CTRL-] three times within 1 second" as the universal escape sequence in tbot. There are a number of reasons for this:

  1. The old (undocumented) ~. would conflict with ssh sessions which means you need to escape the escape sequence (= ~~.) when trying to exit a tbot interactive session inside an ssh session.
  2. Any key-sequence made up of commonly used characters is bound to conflict somewhere. CTRL-] will most likely never show up in actual interaction and even less so as three consecutive presses.

Channel.attach_interactive() will now also print out a message instructing about this escape sequence. This should make sure nobody will ever get stuck inside an interactive session again.

The old "CTRL-D to exit" behavior can be re-activated for specific usecases using a new parameter.

Rahix added 4 commits July 12, 2022 16:20
Let's follow systemd and use "CTRL-] three times within 1 second" as the
universal escape sequence in tbot.  There are a number of reasons for
this:

1. The old `~.` would conflict with ssh sessions which means you need to
   escape the escape sequence (= `~~.`) when trying to exit a tbot
   interactive session inside an ssh session.

2. Any key-sequence made up of commonly used characters is bound to
   conflict _somewhere_.  CTRL-] will most likely never show up in
   actual interaction and even less so as three consecutive presses.

Channel.attach_interactive() will now also print out a message
instructing about this escape sequence.  This should make sure nobody
will ever get stuck inside an interactive session again.

The old "CTRL-D to exit" behavior can be re-activated for specific
usecases by setting the `ctrld_exit` parameter.

Signed-off-by: Harald Seiler <hws@denx.de>
The re-acquisition of the shell needs to deal with the system still
being in the innermost "user shell".  This can happen when the
interactive session is exited by pressing the escape sequence.

Signed-off-by: Harald Seiler <hws@denx.de>
Drop the exit hint as that is now printed by attach_interactive()
already.

Signed-off-by: Harald Seiler <hws@denx.de>
This one should still use CTRL-D to exit behavior so explicitly
re-enable it here.

Signed-off-by: Harald Seiler <hws@denx.de>
@Rahix Rahix marked this pull request as ready for review July 12, 2022 14:47
@Rahix Rahix merged commit 3d95db8 into master Jul 13, 2022
@Rahix Rahix deleted the new-escape branch July 13, 2022 11:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant