You are not logged in.

#1 2010-09-03 16:37:09

hut
Member
From: Hanover, Germany
Registered: 2010-03-12
Posts: 569
Website

[solved] (bash) redrawing prompt

I'm trying to make bash redraw the prompt when using cd inside a command that is bound to a key.

For example, if I bind the command "cd .." to the keys C-x C-d:

bind -x '"\C-x\C-d": cd ..'

and press C-x C-d, it looks like nothing happened, but in fact the directory gets changed. You just don't see the change until you press return and the prompt is redrawn. This may cause bad mistakes when you think you're in the wrong directory.

Any ideas? sad

Last edited by hut (2010-09-03 20:35:57)


"hut_" or "h00th00t" in irc.freenode.net #archlinux
Ranger Mailing List: https://lists.nongnu.org/mailman/listinfo/ranger-users

Offline

#2 2010-09-03 18:00:59

samuele.mattiuzzo
Member
From: Treviso, IT
Registered: 2009-10-12
Posts: 307
Website

Re: [solved] (bash) redrawing prompt

have you tried with C-l? doesn't that refresh the prompt?

Offline

#3 2010-09-03 18:31:58

hut
Member
From: Hanover, Germany
Registered: 2010-03-12
Posts: 569
Website

Re: [solved] (bash) redrawing prompt

samuele.mattiuzzo wrote:

have you tried with C-l? doesn't that refresh the prompt?

Nope, in this case not even C-l helps.
Btw. It works with zsh with "zle -I". I thought there's got to be a bash equivalent.


"hut_" or "h00th00t" in irc.freenode.net #archlinux
Ranger Mailing List: https://lists.nongnu.org/mailman/listinfo/ranger-users

Offline

#4 2010-09-03 18:56:59

hbekel
Member
Registered: 2008-10-04
Posts: 311

Re: [solved] (bash) redrawing prompt

You could either just use a macro:

bind '"\C-x\C-d":"cd ..\C-m"'

or, if you really want to use bind -x:

bind -x '"\201": cd ..'
bind '"\C-x\C-d":"\201\C-m"'

Offline

#5 2010-09-03 20:35:22

hut
Member
From: Hanover, Germany
Registered: 2010-03-12
Posts: 569
Website

Re: [solved] (bash) redrawing prompt

hbekel wrote:

You could either just use a macro:

bind '"\C-x\C-d":"cd ..\C-m"'

or, if you really want to use bind -x:

bind -x '"\201": cd ..'
bind '"\C-x\C-d":"\201\C-m"'

Ah, great. Thanks. I'm glad it's possible.


"hut_" or "h00th00t" in irc.freenode.net #archlinux
Ranger Mailing List: https://lists.nongnu.org/mailman/listinfo/ranger-users

Offline

Board footer

Powered by FluxBB