Skip to content
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

v2 - WindowsDriver isn't render well on conhost terminal size. #2961

Open
BDisp opened this issue Nov 8, 2023 · 7 comments
Open

v2 - WindowsDriver isn't render well on conhost terminal size. #2961

BDisp opened this issue Nov 8, 2023 · 7 comments
Labels

Comments

@BDisp
Copy link
Collaborator

BDisp commented Nov 8, 2023

The right edge is cutting off.

VsDebugConsole_2RYejQxpV3.mp4
BDisp added a commit to BDisp/Terminal.Gui that referenced this issue Nov 8, 2023
@a-usr
Copy link
Contributor

a-usr commented Nov 8, 2023

It looks like something is Triggering the Terminal scrollbar to show up. Or the scrollbar doesnt have time to vanish in time?

@BDisp
Copy link
Collaborator Author

BDisp commented Nov 8, 2023

It looks like something is Triggering the Terminal scrollbar to show up. Or the scrollbar doesnt have time to vanish in time?

Because ANSI escape sequences for enable/disable alternative screen buffer were also sending to the conhost. Only Windows Terminal can handle it.

@a-usr
Copy link
Contributor

a-usr commented Nov 8, 2023

Good to know! and I suppose the alternative screen buffer has better performance than the default one? Just curious.
Edit: I just googled it. So there is no need to answer my question anymore. But still its an interesting Feature! I do wonder however if it is possible to automatically detect the current Terminal Emulator.

@BDisp
Copy link
Collaborator Author

BDisp commented Nov 8, 2023

_isWindowsTerminal = Environment.GetEnvironmentVariable ("WT_SESSION") != null;

When run directly from Windows Terminal the "WT_SESSION" env will have a GUID, otherwise is empty.

@a-usr
Copy link
Contributor

a-usr commented Nov 8, 2023

Another Interesting Fact! Two in a row! However it appears there isnt a standard for this, wich is kind of sad. I suppose its about time for someone to create a new Terminal Emulator standard, as, as per my understanding, the only reason the current one still exists is for backwards compatibility with actual Terminal Hardware. As always, if im wrong you are more than welcome to correct me (Seriously. I want to be Corrected. I'd rather be annoyed by someone correcting me in a extremely nerdy manner, than claim wrong things to be true for ethernety).

@BDisp
Copy link
Collaborator Author

BDisp commented Nov 8, 2023

@tig is already working on a new Terminal Emulator on PR #2940, which only will true color on Windows Terminal, because legacy Win32 API won't work with ANSI escape sequences without Windows Terminal. The only exception is the NetDriver which works with ANSI escape sequences on more terminal because it use .NET System.Console, but is very slower on Windows.
But remember that I'm a nerd explaining this 😃.

@a-usr
Copy link
Contributor

a-usr commented Nov 9, 2023

I believe you meant to say Console Driver instead of Terminal emulator.

Im not sure if you know about this, but way back before computers where directly connected to screen, mouse and keyboard, the only way to interact with them ( or rather their programs ) was through so called Terminals, wich where connected to the computers through a serial connection (i believe) and consisted of a screen, keyboard and a small Logic unit that handled sending user input and rendering received characters to the screen.

Back then the computer (or rather the programs executed on it) could interact directly with the terminal using the ANSI escape codes you mentioned. One such Terminal was the VT 340 (wikipedia).

Modern apps like the old Conhost.exe, Windows Terminal or xterm try to emulate the behaviour of such terminals, wich is why they fall under the category of Terminal Emulators.

Assuming that @tig was born some years before 1987 ( source ) he is probably able to tell you way more about physical/hardware terminals than i ever could, as my only source is online articles and a Github repository

@tig tig added the bug label Nov 16, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Status: No status
Development

No branches or pull requests

3 participants