Bind more than one command to single key in screen?

守給你的承諾、 提交于 2019-12-07 18:53:43

问题


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


回答1:


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.




回答2:


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.



来源:https://stackoverflow.com/questions/8111211/bind-more-than-one-command-to-single-key-in-screen

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!