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

Support for the new Windows Terminal? #612

Open
gonza2323 opened this issue Sep 7, 2024 · 10 comments
Open

Support for the new Windows Terminal? #612

gonza2323 opened this issue Sep 7, 2024 · 10 comments

Comments

@gonza2323
Copy link

gonza2323 commented Sep 7, 2024

Hi,

I understand that the library doesn't support the old cmd.exe terminal. But can it work with the new Windows Terminal? From what I could gather, it supports ANSI escape sequences, and I can run lanterna apps just fine with it when using WSL.

@avl42
Copy link
Contributor

avl42 commented Sep 7, 2024 via email

@mabe02
Copy link
Owner

mabe02 commented Sep 8, 2024

The ANSI escape codes are one thing, but we still rely on stty to some extent for modifying things like echo and special characters. Not sure if there's a way to do that with the window terminal without using native library integration.

@gonza2323
Copy link
Author

Ah ok, I understand, thank you, The current native integration is for the old console, right?

@mabe02
Copy link
Owner

mabe02 commented Oct 6, 2024

Yes, it's using JNI and calls the standard system calls (GetConsoleMode, SetConsoleMode, etc).

@MartyIX
Copy link
Contributor

MartyIX commented Jan 1, 2025

But can it work with the new Windows Terminal? From what I could gather, it supports ANSI escape sequences, and I can run lanterna apps just fine with it when using WSL.

Laterna sort of works with Windows Terminal for my app. The UI is just not properly resized so a lot of content is invisible. So one cannot use it but perhaps some applications with fixed layout can actually work in Windows Terminal.

In WSL, my app works OK as it does on linux.

@avl42
Copy link
Contributor

avl42 commented Jan 2, 2025 via email

@MartyIX
Copy link
Contributor

MartyIX commented Jan 2, 2025

WSL is Linux - as far as relevant for lanterna.

Yes, I'm aware of that1.

I just wanted to make it clear what an alternative is. Still it's not like WSL is always 100 per cent convenient for non-trivial apps like mine2 but generally it's great and extremely useful.

The difference between a cmd.exe (that knows ansi-colors) and a WSL terminal is: access to the features of "stty": with WSL, you can just call stty, whereas for plain cmd.exe you need some native API, thus the special native Terminal- implementation.

Thank you for the explanation. My understanding of this topic is very superficial. Still I think people would love support for the new Windows Terminal. But honestly I have no idea about the scope of work we are talking about here.

Footnotes

  1. If you talk about WSL 2 which is now default I believe. One still can run WSL 1 and there it's more complicated I guess.

  2. Convenience level is 80% exactly. ;)

@avl42
Copy link
Contributor

avl42 commented Jan 2, 2025 via email

@avl42
Copy link
Contributor

avl42 commented Jan 2, 2025 via email

@MartyIX
Copy link
Contributor

MartyIX commented Jan 2, 2025

only WSL 1 could finally be installed. -> I don't know anything about wsl 2.

One can think of WSL 1 as "mapping linux to Windows API" whereas WSL 2 can run a full blown linux distro more like "side by side" with Windows and having access to the machine resources.

So WSL 1 can run only certain linux applications, whereas WSL 2 can run all applications1.

https://learn.microsoft.com/en-us/windows/wsl/compare-versions#comparing-wsl-1-and-wsl-2

WSL 2 is the modern version, WSL 1 is the precedessor (I guess in maintenance mode).

Footnotes

  1. Not sure exactly about GUI apps but it is somehow possible too AFAIK.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants