Ticket #3177 (closed defect: fixed)

Opened 3 years ago

Last modified 3 years ago

Subshell not working under Zsh

Reported by: IceMan Owned by: andrew_b
Priority: major Milestone: 4.8.12
Component: mc-core Version: master
Keywords: subshell, zsh Cc: egmont@…
Blocked By: Blocking:
Branch state: merged Votes for changeset: committed-master

Description

Subshell not working when MC started from Zsh.

GNU Midnight Commander 4.8.11-88-g5f94d51
Built with GLib 2.32.4
Using the S-Lang library with terminfo database
With builtin Editor
With subshell support as default
With support for background operations
With mouse support on xterm and Linux console
With support for X11 events
With internationalization support
With multiple codepages support
Virtual File Systems: cpiofs, tarfs, sfs, extfs, ftpfs, sftpfs, fish
Data types: char: 8; int: 32; long: 32; void *: 32; size_t: 32; off_t: 64;

To reproduce problem you can try:

su - $(whoami) -s /bin/bash -c /usr/bin/mc # works
su - $(whoami) -s /bin/zsh -c /usr/bin/mc # sleeps more than 5 secs at startup, then starts but subshell not working

Attachments

mc-3177-zsh-subshell.patch (475 bytes) - added by egmont 3 years ago.
fix

Change History

comment:1 Changed 3 years ago by egmont

  • Cc egmont@… added

Indeed. It broke at some point after 4.8.11.

An easier way of reproducing: SHELL=/usr/bin/zsh /usr/bin/mc

It sleeps for 10 seconds, as per src/subshell.c feed_subshell()'s wtime.

comment:2 Changed 3 years ago by egmont

git bisect says:
75073307b9f8d500e4b04318f7a78e5b5bf2b884 is the first bad commit
Ticket #3125: don't override precmd on Zsh[...]

Changed 3 years ago by egmont

fix

comment:3 Changed 3 years ago by egmont

Please see the attached fix.
I'm not sure the result is exactly what's intended, but it seems to work, and I took the idea from https://git.gnome.org/browse/vte/tree/src/vte.sh?h=vte-0-36 .

comment:4 Changed 3 years ago by andrew_b

  • Owner set to andrew_b
  • Status changed from new to accepted
  • Milestone changed from Future Releases to 4.8.12

comment:5 Changed 3 years ago by andrew_b

  • Votes for changeset set to andrew_b
  • Branch state changed from no branch to approved

comment:6 Changed 3 years ago by andrew_b

  • Status changed from accepted to testing
  • Votes for changeset changed from andrew_b to committed-master
  • Resolution set to fixed
  • Branch state changed from approved to merged

comment:7 Changed 3 years ago by andrew_b

  • Status changed from testing to closed
Note: See TracTickets for help on using tickets.