Detach from screen without Ctrl+a d in SSH

I'm running a set of processes using the screen command on my Ubuntu server. The idea is that the process should ideally not be cancelled or be under the risk of being cancelled by mistake

I find that using Ctrl + a d is a really risky hotkey for detaching the screen, since using Ctrl+d terminates it.

Is there any way to change the detach hotkey to something else? For example, can I change Ctrl+a d to Ctrl+q?

I tried using an alias, but that didn't work for keyboard commands.

0
задан 12 June 2020 в 12:43

1 ответ

Got this from the screen man page.

To view the bindings in use, press CTRL+a, release and then press ?.

As you indicated d is used to detach.

To change bindings on the fly, you can enter a command mode by pressing CTRL+a then press :

To set a binding, type bind . So to set a new binding for detach type bind z detach.

To remove an existing binding you omit the command portion. So to remove an existing binding for d, you type bind d.

All together...

  1. Remove d binding for detach by pressing CTRL+a then press :. Then type bind d
  2. Remove ^D binding by pressing CTRL+a then press :. Then type bind ^D
  3. Add your own binding by pressing CTRL+a then press :. Then type bind detach

You can place these commands in a .screenrc in the user's home directory to make them persist.

0
ответ дан 19 June 2020 в 21:26

Другие вопросы по тегам:

Похожие вопросы: