Closed lapo-luchini closed 3 weeks ago
I failed to repro this with moar v1.27.2
and iTerm2 3.5.5 (see below).
moar --version
say?I was using v1.27.0
but upgrading to .2
doesn't solve it.
I'm using Windows Terminal, which is usually a good terminal (at least, I never had problems with tmux
and mosh
), but only now I noticed that the rightmost three columns (and last line) are completely black.
This is with seq -s '-' 10 99 | moar -wrap
(which is more readable):
opening it inside tmux
solves the problem while still having two black columns… I guess those are the culprit:
Ok, no, the blank columns/line seems to be because of HiDPI scaling, but the "missing letters column" (which goes away inside tmux
) is I guess a separate issue. 🤔
To rule out Windows specific issues in moar
, would it be possible for you to try this with some other terminal app on Windows?
That would tell us whether this is:
moar
doing something strange on WIndowsmoar
's printoutsI have tried this (on macOS) and it works in:
Unfortunately Windows Terminal requires Windows, and since I'm on macOS that makes this tricky for me to troubleshoot.
I don't have other terminals installed (since Windows Terminal is usually pretty excellent, this one might be the first bug I encounter) but I tried using portable MobaXTerm and it works fine:
Using Windows Terminal I got the same exact bug (last column not showing) in both WSL Ubuntu and Windows native version, both using moar v1.27.2
.
It also happens to me inside the terminal embedded in Microsoft VS Code. Which is available on Linux/FreeBSD and maybe macOS (?).
I tried getting terminal size as suggested here and I got the same width in both tmux
or raw Windows Terminal.
Raw Windows Terminal:
% print "\033[9999;9999H\033[6n"
^[[50;106R
Inside tmux
:
% print "\033[9999;9999H\033[6n"
^[[49;106R
(the difference is only vertical due to the status line)
Seems like VSCode on Windows uses "ConPTY", which is the same thing used by the Windows Terminal IIUC: https://code.visualstudio.com/docs/terminal/advanced#_windows-and-conpty
That's why those are giving the same results.
So AFAICT this is still specific to the Windows Terminal...
Have you tried reporting this at https://github.com/microsoft/terminal?
Note that this could very well be moar
doing something wrong, but since I'm not on Windows and this seems Windows (ConPTY) specific I don't know how I would go about troubleshooting this.
I will report there. 👍🏼 In meantime I tried to reproduce using VSCode on Linux… no bug there. So yes it seems to be Windows-specific.
I believe this is related to how to write the last character of a screen line. If this was moar
getting the size wrong, the wrap would be early rather than missing a character.
Also, since tmux
manages to write there, it is possible, I just need to know how.
If you have a Go setup and want to experiment, the below function might be a good place to start.
Maybe it should be just \n
at line ends? Maybe we should skip \r\n
entirely if the line is as wide as the screen?
If you have a Go setup and want to experiment, the below function might be a good place to start.
I will gladly try. (I know very little Go, but enough to try)
(I did try a bit, no good result so far.)
I also tried conhost
(the "old" Windows terminal)… which produces an "opposite" but similar result… 🤔
This should now be fixed in just-released v1.27.3.
If you could try it out and report back @lapo-luchini that would be super!
Wow, I read the other issue and… what an informative ride! 💙
Thanks for driving this to its conclusion @lapo-luchini!
First line ends with "130 131 132 13[3]" second line starts with "134 135".
Also with different terminal width, still skipping last char on each line: