Ticket #3596 (closed defect: wontfix)
Setting PROMPT_COMMAND in a subshell makes mc to consider that the command is still running
Reported by: | IZh | Owned by: | |
---|---|---|---|
Priority: | major | Milestone: | |
Component: | mc-tty | Version: | 4.8.14 |
Keywords: | Cc: | ||
Blocked By: | Blocking: | ||
Branch state: | no branch | Votes for changeset: |
Description
When you set PROMPT_COMMAND in a subshell, you can't run commands when panels are visible because mc thinks that the command is still running in a subshell.
To reproduce:
1) run: export PROMPT_SUBSHELL="echo zzz"
2) press Ctrl-O to show pannels
3) run: ls
GNU Midnight Commander 4.8.14
Built with GLib 2.38.2
Using the ncurses library
With builtin Editor
With subshell support as default
With support for background operations
With mouse support on xterm
With internationalization support
With multiple codepages support
Virtual File Systems: cpiofs, tarfs, sfs, extfs, ftpfs, fish
Data types: char: 8; int: 32; long: 32; void *: 32; size_t: 32; off_t: 64;
Change History
comment:2 follow-up: ↓ 3 Changed 9 years ago by IZh
Yes, the shell is bash.
But can't CWD be read from shell's /proc/PID/cwd?
comment:3 in reply to: ↑ 2 Changed 9 years ago by mooffie
Replying to IZh:
But can't CWD be read from shell's /proc/PID/cwd?
When the shell finishes executing a command, our PROMPT_COMMAND makes it communicate the CWD to us. But beside learning what's the CWD, we also learn, just by receiving this communication, another important thing: that the shell has finished executing the command (and that it's time to show the panels again). Your proposal doesn't address this issue.
To me too this sounds like wontfix (especially since there's no point in "fixing" something we don't really see people complain about).
comment:4 follow-up: ↓ 5 Changed 9 years ago by zaytsev-work
Well, to me, above all, it's not clear why it is so necessary to have the ability to override PROMPT_COMMAND after starting mc without preserving our hook? If that's done before one starts mc, then everything should be fine.
comment:5 in reply to: ↑ 4 Changed 9 years ago by and
Replying to zaytsev-work:
Well, to me, above all, it's not clear why it is so necessary to have the ability to override PROMPT_COMMAND after starting mc without preserving our hook? If that's done before one starts mc, then everything should be fine.
Normal mc user don't know the background story about $PROMPT_COMMAND signaling,
he can't know that he will in "danger" when changing $PROMPT_COMMAND inside of a mc subshell,
but how to teach mc user?
comment:6 Changed 9 years ago by zaytsev
- Status changed from new to closed
- Resolution set to wontfix
- Milestone Future Releases deleted
but how to teach mc user?
I think we've just performed an act of teaching and it will be documented for future generations, so for now I'll go ahead and close this ticket ;-)
And the shell is Bash, right? We need to override PROMPT_COMMAND with our custom hook to be able to read subshell CWD, so this sounds like a wontfix to me.