[Tcsh] prompt: dim and promptchars

Amol Deshpande amol.vinayak.deshpande at gmail.com
Thu Jul 27 14:12:57 UTC 2023


I have a bunch of changes to enable utf-8 characters in the prompt on
Windows.

https://github.com/amoldeshpande/tcsh/tree/unicode-with-full-vt-restore

Since no one other than me seems to be using the Windows native version, I
didn't spend time to clean it up and make an official patch. For example,
it uses the C++ unordered_map because I got lazy.

Also, I was not 100% sure if non-Windows platforms cared about UTF8 (vs 4
byte wchar_t, which seems to be handled already)

Anyway, you may be able to mine that branch for useful fixes for this
problem.

hope it helps
-amol

On Thu, Jul 27, 2023 at 1:20 AM H.Merijn Brand <tcsh at tux.freedom.nl> wrote:

> 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
>
> --
> Tcsh mailing list
> Tcsh at astron.com
> https://mailman.astron.com/mailman/listinfo/tcsh
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mailman.astron.com/pipermail/tcsh/attachments/20230727/891ac4f0/attachment.htm>


More information about the Tcsh mailing list