Welcome!

By registering with us, you'll be able to discuss, share and private message with other members of our community.

SignUp Now!

prompt with ansi + piping to cygwin's more.exe = destruction of session

Jul
532
10
Can any one explain why my prompt makes it so that if i pipe something to more, the entire terminal session is ruined. Sometimes even with keypresses coming out of thin air. Seemingly being inside of more and back at the prompt at the same time.

It's a glitch like none other

Code:
echo ←P0;8;1;10;0;2;20;0{ @???~}{wo_?/[MFJp@@@@@/GCA@??????/??????????;?_ow{}~???/@@@@@pJFM[/??????@ACG/??????????;??????????/??_ogKYr}{/?_ow\\NVbO/@B@???????;??????????/{}rYKgo_??/ObVN\\wo_?/???????@B@;?_OGCCAaYM/}BEIQayFAA/BKO_oMPIE/____@@AAAA@B@;YaACCGO_??/AFyaQIEB}?/IPMo_OKB?/AAA@@?????@B@;?_OG[cIQaA/}@?_OJ{CAB/BMRaAAANqa/????@@AAAB@B@;aQIc[GO_??/BC{JO_?@}?/qNAAAaRMB?/AAA@@?????←\

prompt=$e[31m $e[1;32;31m$l$e[1;31;31m$e[38;2;101;157;139m$e[38;2;205;143;138m:$e[38;2;171;217;178m$e[38;2;238;188;159m㏘$e[1;32;31m%g $e[0;32;32m$l$e[0;32;33m$e[38;2;213;111;188m3$e[38;2;144;248;251m5٪$e[0;32;32m%g $e[31m $e[1;32;32m$e[1;32;32mC:\Users\ClioC$e[1;32;32m%g$e[0;00;00m$e[39m$e[49m$e[0m$e[?25h$e[ q$e]12;$e]10;rgb:c0/c0/c0$e\$e]11;rgb:00/00/01$e\$e]10;rgb:c0/c0/c1$e\

rem this prompt is glitched but is enough to trigger the bug

dir | c:\cygwin\bin\more.exe

I tested this on a fresh TCC window that doesn't load any of my stuff...


Do this, and your session will be DOOMED. DOOOOOMED!

DOOMED!
 
Possibly the worst console glitch i've seen in my life.

I blame cygwin's more.exe, but still, how can anything be so vulnerable to that?
 
Virtual terminal processing getting turned off, maybe?

You're using Vincent's 4WT plugin, right? What does echo %_vt report?
 
If you are using 4WT, put %_vt in a variety of places (prompt, output) and see if it's ever 0.
 
I used to have ENABLEVT (or something like that) in 4WT. I took it out when I had no problems for a while. I'll put it back in and you can roll your own POST_EXEC alias.
 
What happens if you use the Microsoft Windows version of more.com ?
Code:
R:\>which more
more is an external : C:\WINDOWS\system32\more.com

Ref: More - screen display - Windows CMD - SS64.com

Joe

WTF? a .com that isn't a domain name, but an executable extension? Haven't seen one of those in the wild in awhile. I converted most of mine to 64bit EXEs which work in varying success. Holy moly. .com ... This is what I'm going to use!!!!!!! Thanks!!! I can avoid the problem altogether with this!!!

EDIT: Oh wait. It munges emoji and unicode characters.

The search continues! This will be a good placeholder
 
That's a 64-bit .COM file.

Joe
 
So the crazy thing is now that i put %_vt in my prompt... I can't reproduce it

Not even in the original situation. Which was absolutely reproduceable on a fresh TCC opened with no tcstart.

I am at a loss.

It was neat trying to figure out though. It probably is that ENABLEVT stuff but i guess more.exe isn't consistent? I don't know. Very weird.
 
It was very bizarre. I was clearly at my prompt, and could get short commands like d (alias d=dir) to work.... But typing a 5 letter command would be nigh impossible. The cursor would get suck in the bottom line, but also bounce to seemingly random positions on the line. STDOUT would hit the screen, maybe with a little garbling. And sometimes i'd find myself "back in more.exe" even though I closed it. Maybe something with the alternate screen buffers... those are weird.
 
At one point, the letter "P" just kept going to the screen as if someone was typing it. It filled the screen rapidly. Just had to close the window.
 
Back
Top