Afficher un message
Vieux 31/05/2007, 21h06   #4
Stephane CHAZELAS
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: Mimic zsh's right prompt in bash

2007-05-31, 19:17(+01), Thorsten Kampe:
> * Thorsten Kampe (Thu, 31 May 2007 19:02:46 +0100)
>> * Thorsten Kampe (Thu, 31 May 2007 18:25:17 +0100)
>> > How can I mimic a typical zsh prompt with the current directory at the
>> > right in bash?
>> >
>> > My zsh prompt is:
>> > user@host% /path/to/pwd
>> >
>> > How can I mimic the right hand side in bash with PS1?

>>
>> Oops, that's already been asked in May. I'll read through the
>> thread...

>
> Hm, interesting thread but no answer given. I /guess/ it should be
> possible to mimic the RPS1 in bash by extending the PS1 prompt to the
> right.

[...]

Why don't you use zsh in the first place?

You want to try things like:

PROMPT_COMMAND='printf "%*s\r" "$COLUMNS" "$PWD"'

In anycase, this is bound not to always work, as you need the
shell to be aware that there are characters at the right of the
cursor.

--
Stéphane
  Réponse avec citation
 
Page generated in 0,68005 seconds with 9 queries