[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: gnu screen key binding question - bind a key to: stuff a command + unbind the key binding?



On Tue, 3 Sep 2013, Zenaan Harkness wrote:

Does anyone know off-hand how to bind a key in .screenrc, eg

 bindkey -k k8 screen

so that the bound key causes some keystrokes to go into the terminal
to run that command, as well as "at the same time" (probably just
prior, or after) to unbind that same keybinding from the 'current'
screen session?

minimally altering your example above,

 bindkey -k k8 eval "stuff screen^M" 'bindkey -k k8'

seems to do what you want.

So I guess this is almost a screen script.

The most I've done so far is eg:
bindkey -k k8 screen
to open a new screen.

Also, of note, does anyone know what the difference is between bind
and bindkey. I've tried reading the manpage on these two things a
couple times now, and I'm not properly grokking the difference for
some reason...

i can't claim to grok bindkey at all.  surely someone else does.
hopefully they will enlighten us.  if not, you could try
screen-users@gnu.org .

but bind, unlike bindkey, won't clobber your vanilla use of the bound
key.  for example:

 bind n screen telnet nethack.alt.org

lets me use the 'n' key like usual (like, to type words like
'banana'), unless i prefix it with screen's command character (by
default 'ctrl-a').

hth,
wes


Reply to: