help-bash
[Top][All Lists]
Advanced

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

Readline macro question


From: Robert E. Griffith
Subject: Readline macro question
Date: Fri, 29 Jul 2022 14:09:30 -0400
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.9.1

Is it possible to prevent readline from echoing the text entered through a macro?

Example:

   $ bind '"\eOP": "\C-aecho '\''<up>'\'':\C-m"'
   $ echo '<up>':hello    # i typed "hello" then pressed F1 key (\eOP)
   <up>:hello

Want I am trying to achieve is ...

   $ bind '"\eOP": "\C-aecho '\''<up>'\'':\C-m"'
   $ hello    # the macro leaves the line as it was
   <up>:hello

It would also be ok to write blanks which would effectively erase the line...

   $ bind '"\eOP": "\C-aecho '\''<up>'\'':\C-m"'
   $
   <up>:hello

So I tried using the CSI concealĀ  code like ...

   $ bind '"\eOP": "\C-aecho \e34m'\''<up>'\'':\e0m\C-m"'
   $ echo mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm'<up>':hello
   mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm<up>:hello

But the default ESC binding is to metafy the next character. Removing or replacing the ESC binding had no affect so a related question is "Is is possible to embed CSI codes in a macro?

   $ bind -r "ESC"     # had no affect
   $ bind '"ESC": ""'  # had no affect

--BobG





reply via email to

[Prev in Thread] Current Thread [Next in Thread]