EliziumNet / Loopz

PowerShell iteration utilities with additional tools like the Parameter Set Tools
https://eliziumnet.github.io/Loopz/
MIT License
3 stars 0 forks source link

Show-ParameterSetInfo: columns are misaligned on Unix-like platforms #146

Open mklement0 opened 3 years ago

mklement0 commented 3 years ago

For reference, here's correct output from Windows Terminal:

image

On both macOS 10.15.7 and Ubuntu 18.04, the columns are misaligned:

image

image

plastikfan commented 3 years ago

Yeah, I know about this and this is an outstanding issue that is out of my control. This is caused by another issue(s) in xterm.js/xterm.js Issue 3304 and Issue 2568) which affects macOS/Linux and even vscode on windows. This misalignment occurs in vscode too, even on windows.

At the moment, I have a command Test-WinHostSupportsEmojis, which defaults to enabling emojis on Linux and macOS. I should probably default to not using emjois for Linux and macOS, until these types of issues have been fixed in xterm.js. So that is what I'll implement for this issue.

christianparpart commented 3 years ago

Hi. I just stumbled across your ticked due to my personal interest in grapheme Cluster support in terminals and a small chat with @jerch. Personally i think WT is the only one doing it right in your above screenshots. If a TE renders an emoji symbol that one is too be treated as (East Asian) Wide character (i.e. double width = 2 cells).

While the TEs above seem to render correctly they do NOT position the cursor correctly. They increment the current column only by one instead of 2, therefore your app looks broken.

I think there is a future proof way to convince TE devs to do it like WT does (i think i will propose that in jerch's referenced ticked).

You can work around that btw by using tabstops instead of space characters to move your cursor forwards, so your app looks the same also in non supporting TEs.

If you need tabstops not equal to modulo 8, you can explicitly set tabstops upfront (TBC, HTS).

ref: https://vt100.net/docs/vt510-rm/HTS.html

plastikfan commented 3 years ago

thanks for your contribution @christianparpart. Looking at that vt100 page though doesnt mean anything to me yet. I have found this article on msdn Virtual Terminal Sequences, which hopefully enable me to make sense of how to apply the HTS as you recommend. Cheers.