Home » Questions » Computers [ Ask a new question ]

Macros in GNU screen?

Macros in GNU screen?

I use the screen command line program in Linux all the time, and I looked through the man page but didn't find the answer to this (although maybe I just missed it):

Asked by: Guest | Views: 268
Total answers/comments: 2
Guest [Entry]

"Have you tried:

register s ^aS^i^ac
bindkey ^a,, process s

From the depths of the screen manual:

register [-e encoding] key string

Save the specified string to the register key. The encoding
of the string can be specified via the -e option. See also
the ""paste"" command.

and:

process [key]

Stuff the contents of the specified
register into screen's input
queue. If no argument is given you are
prompted for a register name. The
text is parsed as if it had been typed
in from the user's keyboard. This
command can be used to bind multiple
actions to a single key."
Guest [Entry]

"Screen's command eval is handy for creating this kind of macros:

screen -X bind e eval split 'focus down' screen

Commands expecting arguments (like focus down) need to be quoted (single or double)."