ASSI writes: > It _might_ be possible for this particular case that one could open > /proc/${clientpid}/fd/1 and have it do the right thing. If so, then the > call just above that clobbers stdin with the ttyname would probably be > better off as /proc/${clientpid}/fd/0.
To paraphrase Douglas N. Adams: If you try that, it will do something that's almost, but not quite, entirely unlike what you wanted it to do. --8<---------------cut here---------------start------------->8--- --- origsrc/tmux-3.2/configure.ac 2021-04-13 09:37:43.000000000 +0200 +++ src/tmux-3.2/configure.ac 2021-06-05 11:31:12.985505400 +0200 @@ -1,6 +1,6 @@ # configure.ac -AC_INIT([tmux], 3.2) +AC_INIT([tmux], 3.2p1) AC_PREREQ([2.60]) AC_CONFIG_AUX_DIR(etc) --- origsrc/tmux-3.2/server-client.c 2021-06-05 09:29:04.102404100 +0200 +++ src/tmux-3.2/server-client.c 2021-06-05 11:36:50.162975600 +0200 @@ -2269,7 +2269,19 @@ server_client_dispatch_identify(struct c log_debug("client %p name is %s", c, c->name); #ifdef __CYGWIN__ c->fd = open(c->ttyname, O_RDWR|O_NOCTTY); + /* nope + c->out_fd = dup(c->fd); + */ + if (0 < c->pid) { + /* UNIX domain sockets can't be used to transfer open fd on Cygwin yet */ + char *fdnstr = NULL; + int fdnsz = asprintf(&fdnstr, "/proc/%u/fd/1", c->pid); + if (0 < fdnsz) { + c->out_fd = open(fdnstr, O_RDWR|O_NOCTTY); + free(fdnstr); + } + } #endif if (c->flags & CLIENT_CONTROL) --8<---------------cut here---------------end--------------->8--- It actually runs half the tests that way, but the other half hangs up for unknown reasons. Regards, Achim. -- +<[Q+ Matrix-12 WAVE#46+305 Neuron microQkb Andromeda XTk Blofeld]>+ Samples for the Waldorf Blofeld: http://Synth.Stromeko.net/Downloads.html#BlofeldSamplesExtra -- Problem reports: https://cygwin.com/problems.html FAQ: https://cygwin.com/faq/ Documentation: https://cygwin.com/docs.html Unsubscribe info: https://cygwin.com/ml/#unsubscribe-simple