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

What is .terminfo for Windows Terminal? #6045

Closed
intractabilis opened this issue May 20, 2020 · 17 comments
Closed

What is .terminfo for Windows Terminal? #6045

intractabilis opened this issue May 20, 2020 · 17 comments
Labels
Needs-Tag-Fix Doesn't match tag requirements Needs-Triage It's a new issue that the core contributor team needs to triage at the next triage meeting Resolution-External For issues that are outside this codebase

Comments

@intractabilis
Copy link

Can you share .terminfo for Windows Terminal? I tried to start Midnight Commander from msys command prompt, the keyboard and mouse are not working at all. A usual way to solve it is just to compile .terminfo and set TERM to the corresponding value.

Environment

Microsoft Windows NT 10.0.18363.0
Windows Terminal: 1.0.1401.0

Steps to reproduce

& c:\msys64\usr\bin\bash.exe --login -i
$ export TERM=xterm-256color
$ mc

Same with mc -x.

Expected behavior

I expect Midnight Commander to work

Actual behavior

Midnight Commander doesn't response on any keyboard our mouse input.

@ghost ghost added Needs-Triage It's a new issue that the core contributor team needs to triage at the next triage meeting Needs-Tag-Fix Doesn't match tag requirements labels May 20, 2020
@DHowett
Copy link
Member

DHowett commented May 20, 2020

If youa re using an msys runtime version earlier than cygwin-3.1, you're hitting cygwin's emulation layer. There's nothing we can do about that, and changing your TERM value will not help.

The cygwin emulation layer was finally replaced in cygwin-3.1 with something that detects when the Windows Console (and therefore Terminal) support VT encoded data.

@DHowett DHowett closed this as completed May 20, 2020
@DHowett DHowett added the Resolution-External For issues that are outside this codebase label May 20, 2020
@intractabilis
Copy link
Author

you're hitting cygwin's emulation layer

I am not using cygwin, what are you talking about?

Can you share .terminfo for Windows Terminal?

@DHowett
Copy link
Member

DHowett commented May 20, 2020

msys is based on the cygwin runtime. 😓

I am not sharing the .terminfo for Windows Terminal because changing the TERM value in msys will not fix your problem. Windows Terminal is xterm-256color compatible.

@intractabilis
Copy link
Author

The one that I am using doesn't have any cygwin DLLs.

Whatever, I will compose .terminfo by deciphering your source code.

Thanks.

@DHowett
Copy link
Member

DHowett commented May 20, 2020

You're not really listening to me.

https://github.com/msys2/MSYS2-packages/blob/master/msys2-runtime/0002-Rename-dll-from-cygwin-to-msys.patch

That patch, which is part of the msys2 runtime code, changes the dll name from cygwin to msys2. Msys2 is Cygwin.

I cannot stress this enough:

There is nothing that the terminfo can do to work around msys2's translation layer, which it got from Cygwin.

@intractabilis
Copy link
Author

There's nothing we can do

Everything is fully functional in ConEmu, thus it is possible to do.

@zadjii-msft
Copy link
Member

Hey so we're maybe getting a tad bit off the rails here - lets start from the top.

@intractabilis:

  • What version of msys are you using?
  • Does mc work inside WSL for you?

@intractabilis
Copy link
Author

I just upgraded msys2. Now msys-2.0.dll is 3.1.4 (funny, it's pi). It indeed helped somewhat: the keyboard works.

However, mouse clicks just output escape codes to console as text. Obviously the escape codes are not what ncurses is set to recognize as mouse events. Still no .terminfo?

@intractabilis
Copy link
Author

I don't have WSL.

@zadjii-msft
Copy link
Member

There's not really a terminfo for the Windows Terminal - by all accounts, we're attempting to emulate xterm256-color. If input isn't working for you, then there's probably some other thing that's causing this than just the Terminal.

Using WSL's mc would be a handy way for us to either narrow the issue down to msys, or verify that this is a broader issue with the Terminal

@kibiz0r
Copy link

kibiz0r commented Feb 4, 2021

Adding this in case it helps someone:

I haven't tried this fix with Midnight Commander (I didn't even know what it was until 10 minutes ago), but I had a somewhat similar issue with Gradle output and setting export TERM=cygwin helped me. See gradle/gradle#13279

But then I also ran into an issue with zsh, resulting from that:

zle-line-finish:echoti:1: no such terminfo capability: rmkx
zle-line-init:echoti:1: no such terminfo capability: smkx

I managed to fix that by overriding those functions, as described by https://bbs.archlinux.org/viewtopic.php?id=151738

@ttimasdf
Copy link

TERM value for Windows 10 terminal - Super User

export TERM=ms-terminal

@intractabilis
Copy link
Author

TERM value for Windows 10 terminal - Super User

export TERM=ms-terminal

Still no mouse in mc.

@zadjii-msft
Copy link
Member

We don't maintain a ms-terminal term info value. Anything you find in there is probably outdated and unofficial.

My recommendation has always been to use xterm-256color as our TERM value. Anything in there we don't support is a bug on us that needs fixing.

Mouse support has worked in the Terminal for some time now. It works best in WSL applications. There are some caveats for .exe's using mouse support. #10321 (comment) has some details. But, if y'all are asking about TERM values, I'm assuming the win32 caveats don't apply ☺️

@intractabilis
Copy link
Author

Mouse support has worked in the Terminal for some time now.

I just checked in msys2 with all latest updates. Mouse doesn't work. At least in mc.

@TypedLambda
Copy link

TypedLambda commented Feb 9, 2023

Windows-Terminal is a bit overconfident about its compatibility, they are missing some xterm features.
If your system has no terminal info for ms-terminal on your system, you could add it to your .termcap:

# add this line to ~/.termcap to add support for TERM=ms-terminal
ms-terminal:mi@:IC=\E[%d@:ei@:ic=\E[@:im@:tc=xterm-new:

# if you do not want to change TERM, 
# and make it work with the default TERM=xterm-256color add
xterm-256color:mi@:IC=\E[%d@:ei@:ic=\E[@:im@:tc=xterm-new:

This at least fixes the overtyping/partial update problems I get on some systems.

It would be great to actually supply a terminal config that specifies the real capabilities…

(tested/used mainly to access FreeBSD systems, that would use xterm features not yet implemented. There might be more missing features for other platforms.)

@zadjii-msft
Copy link
Member

@TypedLambda I'd much rather focus on implementing the missing features. Which ones are you missing? IRM was just implemented in 1.17, which is likely the source of any overtyping you may have seen.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Needs-Tag-Fix Doesn't match tag requirements Needs-Triage It's a new issue that the core contributor team needs to triage at the next triage meeting Resolution-External For issues that are outside this codebase
Projects
None yet
Development

No branches or pull requests

6 participants