HomeTutorials › Interactive Terminal
Interactive Terminal

Raw Mode & Escape Hatch

#043 0:12 Part of the Rysh video series

In raw mode every key goes to the program. Ctrl+O is your escape hatch back to Rysh.

Raw Mode & Escape Hatch — 0:12 walkthrough

What you'll see

  1. Launch rysh and open vim notes.txt, entering raw mode automatically.
  2. Show that all keys (Tab, brackets, Escape) are forwarded straight to vim.
  3. Press Ctrl+O to reach prefix mode -- the one reserved escape hatch.
  4. From prefix mode, note d detaches or any other key cancels back into the program.
  5. Quit vim with :q!.

Commands shown

rysh
vim notes.txt
i
raw mode forwards every keystroke
q
:q!

Keys used

EnterEscapeCtrl+o

Transcript

0:00In raw mode every key goes to the program. Ctrl+O is your escape hatch back to Rysh.

0:03Start rysh, then open an interactive program.

0:07Open vim. On the alternate screen, the pane enters raw mode -- Tab, brackets, Escape, every key is forwarded straight to vim.

0:15So how do you reach Rysh's own shortcuts? Ctrl+O. It's the one key raw mode reserves -- the escape hatch out to prefix mode, even while a program owns the screen.

0:27From prefix mode you can detach with d, or press any other key to cancel and drop right back into the program.

0:34Back in vim, quit the usual way -- colon-q-bang to discard.

0:42Raw mode keeps programs happy; Ctrl+O keeps you in control.

Key takeaway
Raw mode forwards every keystroke to the program, while Ctrl+O always reaches Rysh's prefix mode.