terminal: tmux fails to start in local session
Environment
Windows 10.0.18363.0 https://github.com/tmux/tmux/commit/f986539e3c1c8757d443ea61c9c155c36aae38d7 WT @ https://github.com/microsoft/terminal/commit/31efd69149c3b23c000c7491f98254356b1eaf34 Fully updated Cygwin as of 2020-03-26 Fully updated MSYS2 as of 2020-03-26
Steps to reproduce
- Run tmux
Expected behavior
tmux works
Actual behavior
tmux doesn’t work
open terminal failed: not a terminal
Even more info
tmux works fine in
- Cygwin@Mintty
- MSYS2@Mintty
- wsl
- in ssh session
About this issue
- Original URL
- State: closed
- Created 4 years ago
- Comments: 17 (4 by maintainers)
Update
script -c tmux /dev/null. Source. CC @csdvrxRelated info
改为中文看不懂
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:
C:\Cygwin\bin\sh.exe -lc "exec dtach -c /tmp/dtach-shell-$$ -Ez /bin/bash -i"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.
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
Is anyone following up on fixing this in
tmuxitself?How exactly do you get it to work. I copied the binaries but still I get theopen terminal failed: not a terminalon Git BashAfter you copy the binaries from
C:\msys64\usr\bintoC:\Program Files\Git\usr\binI used this alias stollen from netheril96Thank you so much @kasper93 @changyuheng @sfzhi for the research done and workarounds. (I will always be thankful to windows terminal team).
TLDR :
script.exeactually comes withutil-linuxpackage (msys2)it may be already known, but commenting here just to save time for someone like me who is searching for
script.I was wandering around the internet for months to get
tmuxworking in windows terminal (without wsl)For anyone who wants to get
windows terminal+git bash+tmuxwithout installing full package of cygwin or msys, we can do so by getting justtmuxandscriptbinary from msys packages (check once in the msys package page to verify if you already have its dependencies) and putting the so got files in respective folders ofC:/Program Files/Git.References :
script.exe: packages.msys2.org/package/util-linuxscrip.exe is actually in util-linux package: https://github.com/msys2/MINGW-packages/issues/4497If you are using the
scriptscreenordtachworkaround:You’ll need to export a couple of environmental variables in your
.bashrcor.zshrcfiles to get your cool fonts working:Running
tmuxunderscriptseems to be unacceptably slow, especially over SSH.@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.