-
Notifications
You must be signed in to change notification settings - Fork 8.5k
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
tmux fails to start in local session #5132
Comments
This is almost certainly a Cygwin runtime issue, as it’s failing to detect that the windows console host is attached. MinTTY is somewhat of a red herring- it has a special handshake that it does with Cygwin to assume terminal responsibility. How are you launching your Cygwin profile? |
For Cygwin I do (it is the same with bash):
For MSYS2 (but it is Cygwin in disguise, so probably the same issue)
I understand that. I report here, because it would be nice to make it work in WT. But if you tell me that it need to be fixed on Cygwin side I guess I will redirect my request to them. I did quick test with ConEmu and it has the same issue, Ugh, I may have fire to fast with reporting this issue. It seems to be known issue. |
Thanks for following up with all those other issues! Looks like there's a pretty broad problem across terminal emulators on Windows. Do you know if there's actually an upstream bug on cygwin that's tracking this bug? I'd love to resolve this issue as a dup of the upstream one, but I want to make sure the diligence is done |
I searched their ML and there seems to be no report about this specific issue. They don't have public bug tracker except mailing list. I will send them mail and see what they say. |
Since this looks pretty widespread, I'm gonna close out our copy of it. I'd definitely watch their mailing list, though, if I had a link to an ML archive for this report 😄 |
After all I forgot to link here upstream report: https://sourceware.org/pipermail/cygwin/2020-March/244192.html Unfortunately, it went nowhere. Sometimes you need to fix things by yourself... maybe when I feel the need for tmux again. EDIT: And explanation why this actually happens. https://cygwin.com/pipermail/cygwin/2020-May/244878.html |
For those who wish to use Windows Terminal + Cygwin + tmux, there is a workaround. It's not a very elegant one, but it appears to work. Use the following command line in the Windows Terminal profile to start Cygwin: For this to work, dtach must be available in Cygwin. Unfortunately, Cygwin does not provide a binary package. Fortunately, dtach is very small and easy to build from source. |
Update
Related info
|
Thank you so much @kasper93 @changyuheng @sfzhi for the research done and workarounds. TLDR : it may be already known, but commenting here just to save time for someone like me who is I was wandering around the internet for months to get For anyone who wants to get References :
|
改为中文看不懂 |
If you are using the You'll need to export a couple of environmental variables in your export LC_ALL=en_US.UTF-8
export LANG=en_US.UTF-8 |
Is anyone following up on fixing this in |
@changyuheng The statement that you tested ConEmu is pretty vague. I can say that if I try to run cygwin tmux from cmd.exe or cygwin bash in ConEmu, I get the same error as Windows Terminal. If I host a mintty session in ConEmu, I can run tmux, but then I'm running a different terminal emulator that is known to work. |
After you copy the binaries from # placed it in ~/.bash_profile for both GIT BASH and MYSYS2
tmux() {
# execute tmux with script
TMUX="command tmux ${@}"
SHELL=/usr/bin/bash script -qO /dev/null -c "eval $TMUX"
} |
The thing is still not fixed, wow. On top of that, |
Running |
Hi I just inspected the problem, I checked tmux source code and it seems that the key problem is tmux's tty detection failed on Windows Terminal, while the detection on mintty successed: So maybe the problem is, on windows, the cmd.exe or terminal.exe indeed not create a tty file to let the tmux to operate, and they are actually not a real terminal according to the following explanation: Maybe modifying msys2 could change this behavior? Or just not to use windows for development. |
Hi, can anyone interested in this problem please try a tmux branch I'm working on, the police is not letting me test it. It is the https://github.com/rkitover/tmux/tree/cygwin-support To build do this in an MSYS shell on MSYS2: git clone [email protected]:rkitover/tmux
cd tmux
git checkout cygwin-support
pacman -S --noconfirm gcc make bison autoconf automake libevent-devel ncurses-devel pkgconf
sh autogen.sh
./configure --prefix=/usr/local
make -j8 , this will create a |
Add a patch to fix tmux failing to start in a local terminal session when using Microsoft Terminal and other Windows terminals. See: microsoft/terminal#5132 Signed-off-by: Rafael Kitover <[email protected]>
Add a patch to fix tmux failing to start in a local terminal session when using Microsoft Terminal and other Windows terminals. See: microsoft/terminal#5132 Signed-off-by: Rafael Kitover <[email protected]>
Environment
Windows 10.0.18363.0
tmux/tmux@f986539
WT @ 31efd69
Fully updated Cygwin as of 2020-03-26
Fully updated MSYS2 as of 2020-03-26
Steps to reproduce
Expected behavior
tmux works
Actual behavior
tmux doesn't work
Even more info
tmux works fine in
The text was updated successfully, but these errors were encountered: