[Tcsh] prompt: dim and promptchars

H.Merijn Brand tcsh at tux.freedom.nl
Thu Jul 27 08:20:15 UTC 2023


On Thu, 27 Jul 2023 09:52:02 +0200, "H.Merijn Brand" <tcsh at tux.freedom.nl> wrote:

> --8<---
>          ‘%B’, ‘%S’, ‘%U’, and ‘%{string%}’ are available in only eight-
>          bit-clean shells; see the version shell variable.
> 
>                %S (%s)
>                    Start (stop) standout mode.
> 
>                %B (%b)
>                    Start (stop) boldfacing mode.
> 
>                %U (%u)
>                    Start (stop) underline mode.
> 
>                %{string%}
>                    Includes string as a literal escape sequence.  It
>                    should be used only to change terminal attributes
>                    and should not move the cursor location.  This can-
>                    not be the last sequence in prompt.
> -->8---  
> 
> I also want to use "dim" and do so using
> 
>  set prompt="%U%m:%u%{`tput dim`%}%/ %h \U1F427%{`tput sgr0`%} "
> 
> are there plans to include %x syntax for dim too? %D and %d are
> already taken for dd and weekday
> 
> FWIW I also wanted to control %# using promptchars
> 
>  if ($USER == "tux") then
>    set promptchars="\U1F427#"
>  else
>    set promptchars=">#"
>    endif
> 
> but doing so does not show �� but a literal '\'
> using \U1F427 in prompt *does* work. Is that a bug in promptchars?

More fun. Using the real UTF-8 in there does work

% set prompt="%# "
% set promptchars="��䷡"
��

Ohhhh, beautiful :)

now make a typo in a command

�� grex foo bar
Correct > gex foo bar [y|n|E|a]? edit

look at the cursor position. now use any edit keys like home right
arrow or left arrow and look where the cursor is now displayed

conclusion: multibyte characters in the promptchars are not really
usable right now

-- 
H.Merijn Brand  https://tux.nl   Perl Monger   http://amsterdam.pm.org/
using perl5.00307 .. 5.37        porting perl5 on HP-UX, AIX, and Linux
https://tux.nl/email.html http://qa.perl.org https://www.test-smoke.org
                           
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 488 bytes
Desc: OpenPGP digital signature
URL: <https://mailman.astron.com/pipermail/tcsh/attachments/20230727/7f9c3bd7/attachment.asc>


More information about the Tcsh mailing list