<div dir="ltr">I have a bunch of changes to enable utf-8 characters in the prompt on Windows. <div><br></div><div><a href="https://github.com/amoldeshpande/tcsh/tree/unicode-with-full-vt-restore">https://github.com/amoldeshpande/tcsh/tree/unicode-with-full-vt-restore</a><br></div><div><br></div><div>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. </div><div><br></div><div>Also, I was not 100% sure if non-Windows platforms cared about UTF8 (vs 4 byte wchar_t, which seems to be handled already)</div><div><br></div><div>Anyway, you may be able to mine that branch for useful fixes for this problem.</div><div><br></div><div>hope it helps</div><div>-amol</div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Thu, Jul 27, 2023 at 1:20 AM H.Merijn Brand <<a href="mailto:tcsh@tux.freedom.nl">tcsh@tux.freedom.nl</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">On Thu, 27 Jul 2023 09:52:02 +0200, "H.Merijn Brand" <<a href="mailto:tcsh@tux.freedom.nl" target="_blank">tcsh@tux.freedom.nl</a>> wrote:<br>
<br>
> --8<---<br>
>          ‘%B’, ‘%S’, ‘%U’, and ‘%{string%}’ are available in only eight-<br>
>          bit-clean shells; see the version shell variable.<br>
> <br>
>                %S (%s)<br>
>                    Start (stop) standout mode.<br>
> <br>
>                %B (%b)<br>
>                    Start (stop) boldfacing mode.<br>
> <br>
>                %U (%u)<br>
>                    Start (stop) underline mode.<br>
> <br>
>                %{string%}<br>
>                    Includes string as a literal escape sequence.  It<br>
>                    should be used only to change terminal attributes<br>
>                    and should not move the cursor location.  This can-<br>
>                    not be the last sequence in prompt.<br>
> -->8---  <br>
> <br>
> I also want to use "dim" and do so using<br>
> <br>
>  set prompt="%U%m:%u%{`tput dim`%}%/ %h \U1F427%{`tput sgr0`%} "<br>
> <br>
> are there plans to include %x syntax for dim too? %D and %d are<br>
> already taken for dd and weekday<br>
> <br>
> FWIW I also wanted to control %# using promptchars<br>
> <br>
>  if ($USER == "tux") then<br>
>    set promptchars="\U1F427#"<br>
>  else<br>
>    set promptchars=">#"<br>
>    endif<br>
> <br>
> but doing so does not show 🐧 but a literal '\'<br>
> using \U1F427 in prompt *does* work. Is that a bug in promptchars?<br>
<br>
More fun. Using the real UTF-8 in there does work<br>
<br>
% set prompt="%# "<br>
% set promptchars="🐧䷡"<br>
🐧<br>
<br>
Ohhhh, beautiful :)<br>
<br>
now make a typo in a command<br>
<br>
🐧 grex foo bar<br>
Correct > gex foo bar [y|n|E|a]? edit<br>
<br>
look at the cursor position. now use any edit keys like home right<br>
arrow or left arrow and look where the cursor is now displayed<br>
<br>
conclusion: multibyte characters in the promptchars are not really<br>
usable right now<br>
<br>
-- <br>
H.Merijn Brand  <a href="https://tux.nl" rel="noreferrer" target="_blank">https://tux.nl</a>   Perl Monger   <a href="http://amsterdam.pm.org/" rel="noreferrer" target="_blank">http://amsterdam.pm.org/</a><br>
using perl5.00307 .. 5.37        porting perl5 on HP-UX, AIX, and Linux<br>
<a href="https://tux.nl/email.html" rel="noreferrer" target="_blank">https://tux.nl/email.html</a> <a href="http://qa.perl.org" rel="noreferrer" target="_blank">http://qa.perl.org</a> <a href="https://www.test-smoke.org" rel="noreferrer" target="_blank">https://www.test-smoke.org</a><br>
<br>
-- <br>
Tcsh mailing list<br>
<a href="mailto:Tcsh@astron.com" target="_blank">Tcsh@astron.com</a><br>
<a href="https://mailman.astron.com/mailman/listinfo/tcsh" rel="noreferrer" target="_blank">https://mailman.astron.com/mailman/listinfo/tcsh</a><br>
</blockquote></div>