New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Terminal Emulation on Windows without ConPTY results in ANSI Escape Code flooding #4435
Comments
Experiencing this as well. |
The main issue with these two OS is they do not support MSFT's pseudo console API (ConPTY) which is why the behavior is wierd because we had to do some hacks to fake the terminal. But some apps aren't tolerable to how it works, which is why it renders incorrectly at time What specific app are you running, and how does it render? |
The screen shot above does not show any applications. It's just the Windows command shell. |
I'm not running any Applications it's just the command shell this is what types out when i type ipconfig [4;29H[0mi[4;30H[0mp[4;31H[0mc[4;32H[0mo[4;33H[0mn[4;34H[0mf[4;35H[0mi[4;36H[0mg[6;1H |
Can you run the |
osinfo from working and non working os's OS: Microsoft Windows Server 2012 R2 Standard - 9600 [ConPTY: NO] |
It used to be "Ok" - whilst not perfect it could be used for basic tasks as you only generally encountered an issue when text scrolled off the bottom of the screen. However now it's not usable with the control codes being output. |
This is really interesting. I can't reproduce it right now on any of my machines that match match what you guys are running. It looks like it is an issue with the xterm environment in the browser, as that is what is supposed to be interpreting those vt100 codes. I'm looking into it to see if I can find a system that has this issue, then I can test with different server versions to see what happened, or if its a config issue, etc. |
Does it make any difference if you append the following query string to the url in your browser, before connecting the terminal?
|
I checked a few systems and this did not help. |
Same here. Didn’t help and I tried a number of clients including mobile. |
I'm curious if all the people having issue with this, are all running reverse proxies of some type? I'm having a hard time trying to reproduce this issue. I even built multiple test clients running the same versions of windows, and tried the versions of the servers mentioned above. For these systems, the agent side is very simplistic in how it sends the escape codes. It almost seems like something in between is escaping the escape codes... Are all the clients affected on your guys network, or just these windows machines that lack ConPTY? |
@krayon007 ive just tried an old Windows 7 Pro pc we still have around and im experiencing the same, |
No reverse proxies here. I'm running the same config as @si458. |
No reverse proxy here either. it doesn’t impact all our clients |
Ok, can someone try this: Using Firefox, go to the terminal tab, then hit F-12 to bring up the browser console... Then select And then show me what it receives on the websocket... I want to see if the escape codes are arriving correctly, or if they are escaped, etc... Here's what it looks like from one of my Windows machines that lacks ConPTY: |
So from the same browser, some agents work and some dont? |
@krayon007 ok im seeing the same as @sblosser for my Windows 7 machine |
any use? |
When connecting to terminal I get this in the browsers network debug on two messages:
However on the node that has weird behaviour :
And this renders on the terminal browser screen as: |
It looks like the ESC character got dropped... I'll have to check to see if I can figure out where it got dropped... |
Ok... I can also confirm, when I rolled one of my personal mesh server back to 0.9.77, terminal for Windows 7 began functioning correctly. I don't think I have a way to update to in between versions, so will have to take @rowds15 word for non-ConPTY terminal functioning in that version |
Interesting. I'll do some testing with these versions to see if I can spot something. Just for giggles I'll start with an older version and start upgrading to newer versions, as maybe something in the update process screwed something up. |
It will...of course....but something ridiculously inconsequential...like a comma, or a slash in the wrong place 🤣 |
All of you guys that are having issues.... Do you all have minify set to true? |
was in my config. Removing that line...made no difference on my Windows Server 2012 R2 terminal...still had the |
I figured it out. It was indeed related to minification. I'm not sure if when you restarted your server, if minification was undone, it may have still got the setting from the db. I think you need to set it to 0, not remove it... But anyways, the problem was that when win-terminal.js was minified, it for some reason removed the ESC character sequence. I'll have to play around with the minifier he used to get it to not do that... But anyways, there are a few ways to work around this... Either disable minification.... If you edit that file, search for: and you'll see the definition as: you'll need to change it to: Or, alternately, you can just copy |
On a side note, I tested this on Windows Server 2012 R2. Ylian made changes to the minifier a few versions ago, so this is probably how it broke in a recent version. |
@krayon007 I don't use minify and I have this issue? Are u sure it's a minify issue? |
Well, in my case, I was never able to reproduce this issue, until I turned minification on. Then I was able to get it to go back and forth between working and not working, with the above mentioned change. From a usage point of view, everything seems to line up. The ESC sequence was deleted by the minifier, and the minifier was modified in version 1.0.70, which is when people reported this issue happening. And looking at the logs people posted earlier, looking at the raw sequences, it looked like the ESC character was missing, which would explain why the VT100 codes simply printed to the output, instead of being eaten by the console. If you go to your server, do you have an |
the folder does exists at
which network url request should i be inspecting/looking out for with firefox? as it never asks for EDIT: on a fresh |
You won't see that in the browser, becuase it's used by the agent, not the browser. As far as npm, I'm not sure what the default state is from npm, but I know when pulled the server from GIT, it was never there... One way to test if it is a screwed up minification, is to copy the win-terminal.js file from the non minified folder on your server, and place it on your agent manually, in the same folder as the agent... Then either restart the agent, or go to the console tab, and select "clear core", and "load default core".... The agent should use the copy that you manually copied over if the timestamp is newer. But like I said, maybe it will work, if you specify minify in your config, and specify the value as false. |
If you wanted to test what your agent was actually using, to verify your server config... Copy the |
I have success! Unfortunately disabling minifi was not enough. I decided to go in and remove modules_meshcore_min. Once I did that and rebooted, I was able to get a prompt on one of our Windows 7 machines!! I don't care what Ylian says, you're the best Brian!! ;) Cheers! |
Sweet! I'll have to talk to Ylian when he gets back. It may be like the signed agents thing, where if the file exists, the server always uses that... |
beat me to it! |
@krayon007 might be helpful
|
By the way @Matt-CyberGuy earlier I installed an agent on your test system you gave me access to, called: |
Oh right haha! Thanks |
@krayon007 fixed the default for you! #4594 |
@krayon007 |
@si458 If you're referring to https://ylianst.github.io/MeshCentral/meshcentral/config/ I literally just copy/paste the raw file from here: https://raw.githubusercontent.com/Ylianst/MeshCentral/master/meshcentral-config-schema.json It's currently up to date, and I periodically copy/paste it over to update. I only created that page so that all the config items are automatically added to the search index in mkdocs. I don't feel comfortable with updating the source, not sure what to modify about minify (other than typos: dee3f58 :) ) If we need another section about minifycore in here somewhere I'm not sure what to put in there. |
There is still a problem with the terminal on Windows Server 2012 R2, even after modify When I press the arrow keys or del key, backspace is fine. These are the characters that show up.
I also changed |
You did say you deleted the files necessary, did you? |
Hopefully with disabling minification fixes this issue for most people. The issue with the arrow keys is a separate issue caused by the terminal not being an actual pseudo console. That particular issue will require some investigation on my part to find a solution, but I'm not sure if that can be solved, because normally it's the console that handles that, but in this scenario we're not using a real console, which is why up-arrow to show previous commands doesn't work, etc. |
Yes |
All other Windows OS is working fine other than Windows 2012 R2 |
I have the arrow key issue with windows 7 but i think @krayon007 is right, |
Describe the bug
Terminal Emulation on Windows 7 and Server 2008R2 not rendering correctly
To Reproduce
Steps to reproduce the behavior:
Expected behavior
A clear and concise description of what you expected to happen.
Server Software (please complete the following information):
Client Device (please complete the following information):
Remote Device (please complete the following information):
Issue started with version 1.0.70 and yes I know Windows 7 and server 2008 are EOL but.....
The text was updated successfully, but these errors were encountered: