Chris
Chris

Reputation: 3047

Bind more than one command to single key in screen?

how can i bind more than one command to a single key in gnu-screen? I want to combine the two mappings

bind c copy
bind b eval "writebuf" "exec sh -c 'xsel --clipboard < /tmp/screen-exchange'"

to a single one-key mapping. How can this be done?

Does anyone know a good tutorial on this advanced configuration/scripting stuff for gnu-screen?

Thanks in advance, Chris

Upvotes: 6

Views: 1445

Answers (2)

Frank-Rene Sch&#228;fer
Frank-Rene Sch&#228;fer

Reputation: 3352

I use

     bind \# eval focus "resize 130"

for example to switch between two vertical split windows and resize, at the same time, the focused window to 130 columns (pressing "C-A #").

So, the concatenation of multiple commands with 'eval' seems to work properly.

Upvotes: 4

Arkku
Arkku

Reputation: 42149

Pass each command as a separate argument to eval, e.g., eval "echo foo" "echo bar". In your given scenario, I would think that just adding copy after eval would do what you want.

Upvotes: 7

Related Questions