[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: fg via keybind modifies tty settings
From: |
Martin D Kealey |
Subject: |
Re: fg via keybind modifies tty settings |
Date: |
Mon, 18 Nov 2024 14:49:32 +1000 |
On Sun, 17 Nov 2024 at 04:52, David Moberg <kaddkaka@gmail.com> wrote:
> That looks very complicated, how do interpret that? And where/when to run
> it?
>
To me this seems to have taken a wrong turn before the question was even
asked.
Just because readline has a "run a command" mode does NOT mean it's
necessarily the appropriate way to invoke the 'fg' command. As clearly
shown in the manual, there's a whole bunch of stuff around bind -x that's
intended to support invoking a command *as a way to do specialised editing
within the command line.*
This is clearly *not* "editing within the command line", so just do it the
old fashioned way, with a macro:
bind -m emacs '"\C-_":"\C-e\C-ufg\n"'
bind -m vi '"\C-_": "ddafg\C-j"'
bind -m vi-insert '"\C-_":"\e0Cfg\n"'
(Choose your own preferred key instead of ctrl-_ of course)
These all do the same thing in different input modes: erase the current
line, then type "fg" and enter it. (If you actually want to keep the text
that was in the edit buffer, you can just paste it back in at the next
prompt; ctrl-Y ("yank") in emacs mode, and p or P ("put") in vi mode.)
-Martin
- Re: fg via keybind modifies tty settings, David Moberg, 2024/11/05
- Re: fg via keybind modifies tty settings, Chet Ramey, 2024/11/07
- Re: fg via keybind modifies tty settings, Martin D Kealey, 2024/11/10
- Re: fg via keybind modifies tty settings, Chet Ramey, 2024/11/12
- Re: fg via keybind modifies tty settings, David Moberg, 2024/11/16
- Re: fg via keybind modifies tty settings, #!microsuxx, 2024/11/16
- Re: fg via keybind modifies tty settings, #!microsuxx, 2024/11/16
- Re: fg via keybind modifies tty settings, David Moberg, 2024/11/16
- Re: fg via keybind modifies tty settings, #!microsuxx, 2024/11/16
- Re: fg via keybind modifies tty settings, #!microsuxx, 2024/11/16
- Re: fg via keybind modifies tty settings,
Martin D Kealey <=
- Re: fg via keybind modifies tty settings, Chet Ramey, 2024/11/18
- Re: fg via keybind modifies tty settings, David Moberg, 2024/11/27
- Re: fg via keybind modifies tty settings, Martin D Kealey, 2024/11/28
- Re: fg via keybind modifies tty settings, Martin D Kealey, 2024/11/17