Re: Send break to screen

Michael Parson <[email protected]>
Newsgroups gmane.comp.gnu.screen.user
Message-ID <[email protected]>
On Fri, 30 Sep 2016, Clark Wang wrote:
> On Fri, Sep 30, 2016 at 1:30 AM, Michael Parson <[email protected]> wrote:
>> On Thu, 29 Sep 2016, Clark Wang wrote:
>>>
>>> Where is this kind of usage (stuff ^X) documented? I did not found it in
>>> screen manual.
>>
>> The 'stuff' command is in the screen manpage:
>>
>> 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 parameter, 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".
>>
>> The usage they are using is a combo of using 'stuff' with the '-X' flag
>> which lets you send commands to a screen session via the shell (rather
>> than from the : prompt inside of screen).
>>
> I'm actually asking about the ^X part. That's to say where is it documented
> that the *stuff* command would interprete the ^X as CTRL-X?

It's not spelled out that the 'stuff' command would interpret ^X as
CTRl-X, but it does say to use the caret notation early in the
documentation under the "DESCRIPTION" header:

   Screen does not understand the prefix "C-" to mean control, although
   this notation is used in this manual for readability.  Please use
   the caret notation ("^A" instead of "C-a") as arguments to e.g. the
   escape command or the -e option.  Screen will also print out control
   characters in caret notation.

> I also found that *stuff* understands C-style escapes (like \t, \n and
> \040) but I did not found the related document either.

Again, not spelled out for the 'stuff' command, but it is mentioned
under the instructions for 'bind' (and 'stuff' does mention that it is
often used as a 'bind' command:

   bind  [-c class] key [command [args]]

   Bind a command to a key.  By default, most of the commands provided by
   screen are bound to one or more keys as indicated in the "DEFAULT KEY
   BINDINGS" section, e.g. the command to create a new window is bound to
   "C-c" and "c".  The "bind" command can be used to redefine the key
   bindings and to define new bindings.  The key argument is either a
   single character, a two-character sequence of the form "^x" (meaning
   "C-x"), a backslash followed by an octal number (specifying the ASCII
   code of the character), or a backslash followed by a second character,
   such as "\^" or "\\".  The argument can also be quoted, if you like.
   If no further argument is given, any previously established binding for
   this key is removed.  The command argument can be any command listed in
   this section.

Sometimes, one has to take the 'well, if it works there, maybe it works
here' attitude and try it.

-- 
Michael Parson
Pflugerville, TX
KF5LGQ
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.