public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
* "tmux open terminal failed: not a terminal" in terminal emulators other than mintty
@ 2020-03-26 17:52 Kacper Michajlow
  2020-03-26 19:04 ` Andrey Repin
  0 siblings, 1 reply; 5+ messages in thread
From: Kacper Michajlow @ 2020-03-26 17:52 UTC (permalink / raw)
  To: cygwin

Hi,

I'm not exactly sure who to blame for this issue, but I figured I will ask
you guys. Tmux fails to open in anything else than mintty it seems like. It
works from ssh session, probably because pseudo-tty is allocated, but
except that tmux will fail.

There are multiple reports about that, without solutions:
https://github.com/cmderdev/cmder/issues/453
https://github.com/alacritty/alacritty/issues/1687
https://github.com/zeit/hyper/issues/3608
https://github.com/microsoft/terminal/issues/5132

Do you think we could make it work without using mintty?
If yes, should the changes be made in the Cygwin, tmux or terminal emulator
code?
Any pointer would be good so I can poke others :)

Thanks,
Kacper

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: "tmux open terminal failed: not a terminal" in terminal emulators other than mintty
  2020-03-26 17:52 "tmux open terminal failed: not a terminal" in terminal emulators other than mintty Kacper Michajlow
@ 2020-03-26 19:04 ` Andrey Repin
  2020-03-27 13:27   ` Kacper Michajlow
  0 siblings, 1 reply; 5+ messages in thread
From: Andrey Repin @ 2020-03-26 19:04 UTC (permalink / raw)
  To: Kacper Michajlow, cygwin

Greetings, Kacper Michajlow!

> I'm not exactly sure who to blame for this issue, but I figured I will ask
> you guys. Tmux fails to open in anything else than mintty it seems like. It
> works from ssh session, probably because pseudo-tty is allocated, but except
> that tmux will fail.

> There are multiple reports about that, without solutions:
> https://github.com/cmderdev/cmder/issues/453
> https://github.com/alacritty/alacritty/issues/1687
> https://github.com/zeit/hyper/issues/3608
> https://github.com/microsoft/terminal/issues/5132

> Do you think we could make it work without using mintty?

You can try another pty emulator. F.e. wintty.

> If yes, should the changes be made in the Cygwin, tmux or terminal emulator
> code?
> Any pointer would be good so I can poke others :)


-- 
With best regards,
Andrey Repin
Thursday, March 26, 2020 22:02:58

Sorry for my terrible english...


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: "tmux open terminal failed: not a terminal" in terminal emulators other than mintty
  2020-03-26 19:04 ` Andrey Repin
@ 2020-03-27 13:27   ` Kacper Michajlow
  2020-03-27 20:15     ` Michael Wild
  0 siblings, 1 reply; 5+ messages in thread
From: Kacper Michajlow @ 2020-03-27 13:27 UTC (permalink / raw)
  To: cygwin

> You can try another pty emulator. F.e. wintty.

Not really interested in some dead projects ;p

Let me rephrase the question, because I misspoke.

Currently Cygwin works acceptably only under Mintty as far as I can see.
Running it from cmd or any of terminal emulators listed before result in
sub-par performance. Even things like Home button to move cursor doesn't
work, as originally stated tmux doesn't work and so on.

Now that Windows is making improvements to their console
https://devblogs.microsoft.com/commandline/windows-command-line-introducing-the-windows-pseudo-console-conpty/
it may be good time to improve Cygwin's compatibility.

Since my first mail I looked at git log and seen pty related changes,
compiled latest Cygwin, but it doesn't work better and even worse, because
mouse stopped working over ssh in tmux.

That said, I guess my really questions are:
1. Is the goal to improve Windows console compatibility?
2. If yes, what is the current status and challenges?
3. And my original question will the tmux work? :)

Projects like Windows Terminal are convenient way to have PS, CMD, Cygwin
and its child MSYS in one window hence I am wondering if it will be
possible without drawbacks.

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: "tmux open terminal failed: not a terminal" in terminal emulators other than mintty
  2020-03-27 13:27   ` Kacper Michajlow
@ 2020-03-27 20:15     ` Michael Wild
  2020-05-16 19:35       ` Kacper Michajlow
  0 siblings, 1 reply; 5+ messages in thread
From: Michael Wild @ 2020-03-27 20:15 UTC (permalink / raw)
  To: The Cygwin Mailing List

On Fri, 27 Mar 2020, 14:29 Kacper Michajlow wrote:

> > You can try another pty emulator. F.e. wintty.
>
> Not really interested in some dead projects ;p
>
> Let me rephrase the question, because I misspoke.
>
> Currently Cygwin works acceptably only under Mintty as far as I can see.
> Running it from cmd or any of terminal emulators listed before result in
> sub-par performance. Even things like Home button to move cursor doesn't
> work, as originally stated tmux doesn't work and so on.
>
> Now that Windows is making improvements to their console
>
> https://devblogs.microsoft.com/commandline/windows-command-line-introducing-the-windows-pseudo-console-conpty/
> it may be good time to improve Cygwin's compatibility.
>
> Since my first mail I looked at git log and seen pty related changes,
> compiled latest Cygwin, but it doesn't work better and even worse, because
> mouse stopped working over ssh in tmux.
>
> That said, I guess my really questions are:
> 1. Is the goal to improve Windows console compatibility?
> 2. If yes, what is the current status and challenges?
> 3. And my original question will the tmux work? :)
>
> Projects like Windows Terminal are convenient way to have PS, CMD, Cygwin
> and its child MSYS in one window hence I am wondering if it will be
> possible without drawbacks.
>

Hi

As the maintainer of the tmux Cygwin package I have to admit that I have no
idea how to fix this. Sorry.

Kind regards

Michael

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: "tmux open terminal failed: not a terminal" in terminal emulators other than mintty
  2020-03-27 20:15     ` Michael Wild
@ 2020-05-16 19:35       ` Kacper Michajlow
  0 siblings, 0 replies; 5+ messages in thread
From: Kacper Michajlow @ 2020-05-16 19:35 UTC (permalink / raw)
  To: The Cygwin Mailing List

On Fri, 27 Mar 2020 at 21:15, Michael Wild via Cygwin <cygwin@cygwin.com>
wrote:

> Hi
>
> As the maintainer of the tmux Cygwin package I have to admit that I have no
> idea how to fix this. Sorry.
>

Hi,

I did take a look how tmux works and what is going on in Cygwin. Here is
short summary of my findings.

* Tmux sends each client stdio fd to the server through socket. Cygwin does
not support passing file descriptors over to other processes so this fails.
* Tmux has a hack for Cygwin where it opens tty by name provided by
client...

And now there are two cases:

1. When there is no pseudo terminal. cmd.exe, (WT and most other terminal
emulators out there)
* Tmux server will try to open /dev/cons<N> by name provided by client, but
this fails with ENOENT, because server process doesn't see this device.

2. When there is allocated pseudo terminal
* Tmux server will try to open /dev/pty<N> by name provided by client and
actually work.

Is there a way to make tmux work with /dev/cons<N>? I have seen in docs

/dev/cons1	Console device names are pseudo device names, only accessible
...		from processes within this very console session.  This is due
		to a restriction in Windows.

So it likely means that whatever we do it will not be accessible from
another process.

Is this docs still holds true in latest Windows? I have seen a path to
always allocate pty for native applications, maybe this would actually
resolve this problem too.

Best Regards,
Kacper

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2020-05-16 19:35 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-03-26 17:52 "tmux open terminal failed: not a terminal" in terminal emulators other than mintty Kacper Michajlow
2020-03-26 19:04 ` Andrey Repin
2020-03-27 13:27   ` Kacper Michajlow
2020-03-27 20:15     ` Michael Wild
2020-05-16 19:35       ` Kacper Michajlow

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).