GNU Screen Bindkeyコマンドを使用してキーストロークを入力できますか?

GNU Screen Bindkeyコマンドを使用してキーストロークを入力できますか?

F1特定のキー(たとえば)を押したときに最初にクリックしてEnterから、Screenコマンドを押すのと同じカスタムキーバインディングをGNU Screenで作成したいと思いますnext

キー入力を画面コマンドにバインドすることは可能ですが、bindkey「Enter」キーを押すなどの他のコマンドライン入力をトリガーするためにも使用できますか?

ベストアンサー1

stuffはい、screenコマンドを使用できます。マニュアルページからscreen

   stuff [string]

   Stuff  the string string in the input buffer of the current window.  This is
   like the "paste" command but with much less overhead.  Without  a  paramter,
   screen  will  prompt  for a string to stuff.  You cannot paste large buffers
   with the "stuff" command. It is most  useful  for  key  bindings.  See  also
   "bindkey".

また、マニュアルページで次の例を見ることができます。

           bindkey -k k1 select 1
   Make the "F1" key switch to window one.

           bindkey -t foo stuff barfoo
   Make  "foo"  an  abbreviation  of the word "barfoo". Timeout is disabled so that
   users can type slowly.

たとえば、次の行を$HOME/.inputrcファイルに追加して入力バッファに書き込みF1をバインドできます(を押すのと同じ)。\nEnter

bindkey -k k1 stuff "\n"

おすすめ記事