Sample Header Ad - 728x90

How to use bind -x and redraw the line in bash readline?

0 votes
1 answer
111 views
I'm using bind -x in vi-command mode to remap a keyboard character to a direct bash command, which in my case alters the current line (cd ..). Is there a way to at the same time map with -x AND execute the inbuilt redraw-current-line command? So this is what I have:
bind -m vi-command -x '"-": "cd .."'
This works halfway, then I tried this:
bind -m vi-command -x '"-": "cd .."'` "-":redraw-current-line
But this doesn't work, I think the whole command is now flawed and readline goes back to the custom shortkey for - which is to scroll history. Is there a workaround for this?
Asked by glades (117 rep)
Sep 5, 2024, 02:41 PM
Last activity: Sep 20, 2024, 05:20 PM