What is .terminfo for Windows Terminal? #8350

Closed
opened 2026-01-31 01:27:13 +00:00 by claunia · 17 comments
Owner

Originally created by @intractabilis on GitHub (May 20, 2020).

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.

Originally created by @intractabilis on GitHub (May 20, 2020). 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 ```none 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.
claunia added the Needs-TriageResolution-ExternalNeeds-Tag-Fix labels 2026-01-31 01:27:13 +00:00
Author
Owner

@DHowett commented on GitHub (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 commented on GitHub (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.
Author
Owner

@intractabilis commented on GitHub (May 20, 2020):

you're hitting cygwin's emulation layer

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

Can you share .terminfo for Windows Terminal?

@intractabilis commented on GitHub (May 20, 2020): > you're hitting cygwin's emulation layer I am not using cygwin, what are you talking about? Can you share .terminfo for Windows Terminal?
Author
Owner

@DHowett commented on GitHub (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.

@DHowett commented on GitHub (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.
Author
Owner

@intractabilis commented on GitHub (May 20, 2020):

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

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

Thanks.

@intractabilis commented on GitHub (May 20, 2020): The one that I am using doesn't have any cygwin DLLs. Whatever, I will compose .terminfo by deciphering your source code. Thanks.
Author
Owner

@DHowett commented on GitHub (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.

@DHowett commented on GitHub (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.**
Author
Owner

@intractabilis commented on GitHub (May 20, 2020):

There's nothing we can do

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

@intractabilis commented on GitHub (May 20, 2020): > There's nothing we can do Everything is fully functional in ConEmu, thus it is possible to do.
Author
Owner

@zadjii-msft commented on GitHub (May 20, 2020):

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?
@zadjii-msft commented on GitHub (May 20, 2020): 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?
Author
Owner

@intractabilis commented on GitHub (May 20, 2020):

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 commented on GitHub (May 20, 2020): 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?
Author
Owner

@intractabilis commented on GitHub (May 20, 2020):

I don't have WSL.

@intractabilis commented on GitHub (May 20, 2020): I don't have WSL.
Author
Owner

@zadjii-msft commented on GitHub (May 20, 2020):

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

@zadjii-msft commented on GitHub (May 20, 2020): 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
Author
Owner

@kibiz0r commented on GitHub (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 https://github.com/gradle/gradle/issues/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

@kibiz0r commented on GitHub (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 https://github.com/gradle/gradle/issues/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
Author
Owner

@ttimasdf commented on GitHub (Jan 13, 2023):

TERM value for Windows 10 terminal - Super User

export TERM=ms-terminal
@ttimasdf commented on GitHub (Jan 13, 2023): [TERM value for Windows 10 terminal - Super User](https://superuser.com/questions/1691010/term-value-for-windows-10-terminal) ```bash export TERM=ms-terminal ```
Author
Owner

@intractabilis commented on GitHub (Jan 13, 2023):

TERM value for Windows 10 terminal - Super User

export TERM=ms-terminal

Still no mouse in mc.

@intractabilis commented on GitHub (Jan 13, 2023): > [TERM value for Windows 10 terminal - Super User](https://superuser.com/questions/1691010/term-value-for-windows-10-terminal) > > ```shell > export TERM=ms-terminal > ``` Still no mouse in mc.
Author
Owner

@zadjii-msft commented on GitHub (Jan 13, 2023):

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. https://github.com/microsoft/terminal/issues/10321#issuecomment-855083607 has some details. But, if y'all are asking about TERM values, I'm assuming the win32 caveats don't apply ☺️

@zadjii-msft commented on GitHub (Jan 13, 2023): 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. https://github.com/microsoft/terminal/issues/10321#issuecomment-855083607 has some details. But, if y'all are asking about `TERM` values, I'm assuming the win32 caveats don't apply ☺️
Author
Owner

@intractabilis commented on GitHub (Jan 13, 2023):

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.

@intractabilis commented on GitHub (Jan 13, 2023): > 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.
Author
Owner

@TypedLambda commented on GitHub (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.)

@TypedLambda commented on GitHub (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.)
Author
Owner

@zadjii-msft commented on GitHub (Feb 9, 2023):

@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.

@zadjii-msft commented on GitHub (Feb 9, 2023): @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 in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#8350