Sunday·06·October·2013
Searching in Screen’s copy mode //at 23:43 //by abe
I’m using GNU Screen daily for definitely more than a decade and I became maintainer of Debian’s screen package nearly exactly two years ago. Nevertheless it still happens occassionally that I discover features yet unknown to me. Recently I had one of these moments again:
I looked for a specific line in the long output of a command which has run
inside a Screen session. For that I entered Screen’s copy mode with
Ctrl-A [
and scrolled around with arrow keys and page-up
and -down keys.
But didn’t find it. I thought, it would be cool if I can search for
the string I’m looking for. Intuïtively I typed /
,
the search string and pressed enter. And it worked! It jumped to the
next occurrence of that string.
Of course I immediately had to check if tmux has such a feature, too. And it indeed has, but it seems to be a less sophisticated implementation:
Feature | Key-binding in GNU Screen | Key-binding in Tmux |
---|---|---|
Switch into copy/scroll mode (needed for the remainder) |
Ctrl-A [ |
Ctrl-B [ |
Search for string once, forward | / + string + Enter |
Ctrl-S + string + Enter |
Search for string once, backward | ? + string + Enter |
Ctrl-R + string + Enter |
Search for string again, forward | / Enter |
Ctrl-S Enter |
Search for string again, backward | ? Enter |
Ctrl-R Enter |
Incremental search for string, forward | Ctrl-S + string |
- |
Incremental search for string, backward | Ctrl-R + string |
- |
(Incremental) search for next occurrence, forward | Ctrl-S again |
- |
(Incremental) search for next occurrence, backward | Ctrl-R again |
- |
Being able to do incremental search like with GNU Emacs gave me yet
another reason for continuing to use Screen and not to switch Tmux.
;-)
Tagged as: copy mode, feature, GNU Screen, screen, search, tmux
// show without comments // write a comment