-
Notifications
You must be signed in to change notification settings - Fork 3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Subshell] Support for ash + bugfixes for bash, fish #2742
Comments
Fix bash issue: INPUTRC was never set correctly, thus never used. |
New subshell types Busybox ash + Debian ash (dash) and some more enhancements plus fish chdir bugfix |
Improved subshell chapter in online help plus some minor code changes |
By the way: The BusyBox problem with 4-digit octal codes in printf has been fixed upstream yesterday. But because it will be available in version 1.20 earliest and many distributions around will still use older versions for a while, I guess my workaround with echo should remain in the patch for a while. |
|
The patches attached to this ticket are successfully used for more than a year in freetz.org project. Attaching a version of the patches updated for mc-4.8.8. We would appreciate it if the patches could be applied upstream. Thanks!
Edit: the busybox-printf workaround is not needed anymore, thus commented out but still included in this patch |
|
|
|
Sorry, I disagree with this change:
I have custom prompt which shows me in addition current branch name when I entered in GIT repo tree. |
I do not understand. This is just the prompt for the MC subshell, it does not replace your parent shell's prompt. What I did here was merely to improve the old behaviour to make the prompt nicer and more informative. It is not new functionality, just fixing/improving the old one which also creates a custom prompt for the subshell, totally independent of the parent shell. So your concern seems rather irrelevant IMO. Have you even tried?
Sorry, I cannot check/verify anything now because I am on the road, nowhere near a Linux machine. I am answering from memory and from what I see in the patch. |
On master branch I see prompt like:
this my custom prompt. Within your changes I see like:
The prompt doesn't contain a branch name, as is defined in my ~/.bashrc file:
So looks like your changes rewrites a Bash-prompt from ~/.bashrc file |
Created branch 2742_ash, initial [f1ceb68592c7f48832b7abc5b5769153c1e8b55e]
Please review. |
I hope I can investigate your remark during the weekend. The ticket is 18 months old, so probably it is not urgent now for you. Thanks for your patience until then. :-) |
It was our pleasure ;)
Of course, we can await, no problem.
Ticket in 'hold' stage now. Thank you for your time. |
Just a friendly reminder that there re other tickets blocked by this. There are several patches attached to this ticket - it would be great if some of them could be merged already if they're not affected by prompt issue. |
Dear makers of MC, dear Slava,
I just tested a self-compiled MC 4.8.11 (fresh download, plain vanilla upstream package) without my patch and as I remembered from older versions, it also overwrites the Bash prompt by something much like I did for Ash. So my patches did not break or change any existing behaviour, they just replicate for Ash what exists for Bash.
Please either extend or rewrite subshell support by yourself or just use my patches to improve the status quo and permit for more shells to be supported and a few little bugs to be fixed.
Thank you and kind regards, Alexander. |
Is this related to recently fixed #3232? |
No, it is complementary. If you read the ticket description it becomes clear. |
|
|
Any plans to move this forward? |
yep. I'm working with the ticket right now |
|
merged into master: [b5bfa00]
|
https://www.midnight-commander.org/wiki/NEWS-4.8.16?action=diff&version=2&old_version=1 |
Shouldn't the wiki entry relate to this ticket rather than to #3547? |
yep, you're right. Fixed. |
Folks, I don't know if it's a problem or not, but subshell.c now has:
There are two sets of PROMPT_COMMAND voodoo here and they're not identical. Is this intentional?
Also:
Do we lose the ability to set custom PS1 in our .bashrc? (see comment:5, comment:7) My test shows that we don't. So I was wondering what effect the "PS1=..." in the C code has. |
Great. Thanks!
Another issue. The documentation's diff is:
I'm not sure users will understand (nor I understand) what "dynamic prompt" means, and whether "like" means that we can change it. If we can change it, what's the difference between this "dynamic prompt" (which is reported to be missing from Bash) and Bash's "same prompt that you are currently using in your shell"? |
Dynamic means that it shows the current user, host and path (pwd). Without the patch you have a dumb, static prompt for the subshell if you use a simple shell like Busybox Ash or Dash. |
Replying to kriegaex:
OK. I'm just concerned about the clarity of the documentation. Wouldn't the following be a simpler way to describe MC's behavior?
(If we want to be less Bash-centric, we can replace "When using Bash, or a similarly capable shell," with "When using a capable shell, like Bash,")
OTOH, if you think the documentation is OK as it is, I'm fine: close this ticket; I won't re-open it. |
Sounds nice, feel free to improve. This is OSS. ;-) Currently Bash is really an explicit exception though, as far as I remember. My patch is really old - look at the ticket creation date - and the first and last C language experiment I ever made. |
Just FYI, doc patches can go directly into master. |
|
Subshell is gone after upgrading from 4.8.16 to 4.8.17. So this patch (in [b5bfa00]) makes subshell disabled in my environment. A couple of days ago port misc/mc was updated to the new version and after upgrading mc subshell have gone. When I press Ctrl-O it shows saved console very well, but without shell prompt. So pressing any key in that mode returns mc to its panel view. No subshell. This happens only in csh, when the user with bash shell logs in, everything works well.
I use FreeBSD: FreeBSD 9.3-RELEASE-p38 #11 [296611]: Thu Mar 10 14:24:38 FET 2016
I make some bisection with git and found exactly this first bad commit. So, before it everything works almost well (I mean the patch in FreeBSD ports for correcting console saving behavior in Ctrl-O mode - mc shows blank console).
Hope, it helps to correct the /bin/csh issue. |
|
Apparently, this comment /* Also detects csh symlinked to tcsh */ was a lie. Go trust submitters... How about the attached patch, does this fix the problem for you? |
|
Yes. It works well now. Thanks a lot! |
I cannot help but detect an undercurrent of sarcasm in your voice. All I can say is: I tested it on two systems (one desktop Ubuntu and one embedded Linux) four years ago when I created the patch and it worked. Patches have a tendency to deteriorate or just rot if not applied for a long time. I am sorry this caused pain for someone anyway. I meant to scratch my own itch and it worked nicely for me and still does. Thanks for "trusting a submitter", but I think a code review and retest are fully in order, considering the fact that mc runs on so many systems. No reason to blame a submitter, though. It is just unfair. |
@kriegaex: Don't take it personally. Yury had a rough couple of days: 4.6.16 was released and a few critical bugs were found, requiring some stressed work on his part alone (and having to function as a punchbag). He was just venting steam. We ought to thank the gods for him doing merely this instead of quitting. Ditto for Andrew. So cheer up and continue contributing :-) |
Understood and accepted. Yury's and Andrew's work is appreciated. I just wanted to make it very clear that I am not a punchbag either. |
Indeed, I found the situation rather ironic, since it is with you specifically that we had a number of conversations on the mailing list and privately with regards to the processing of contributed patches. The last conversation of this sort has triggered Slava to go ahead and commit this particular patch without proper review.
Of course, it's my fault that I didn't object to that, but I didn't want to get into yet another argument. Very unfortunately, we don't have the resources to review the patches quickly as they should be reviewed, so there are two choices out there: (1) do superficial reviews, but commit most likely broken code, or (2) let the patches rot for years until you manage to do a proper review, but piss off the submitters.
In the first case, you get yelled at, because it's your fault that you commit broken stuff, in the second case, you get endless arguments about how slowly the patches are being accepted. So, whatever you do, you have to take the shit and the only way for you to *not* to take the shit is to leave the project.
Hence, I couldn't help myself, but leave a sarcastic comment as I understood what the problem was. If you look at the "fix", you'll see that it doesn't have anything to do with your patch rotting over years. It was a genuine logical mistake to leave out a condition that previously existed, without replacing it with an equivalent one.
Still, I agree that it's the reviewers fault; the submitter by definition isn't supposed to know every dark corner of the code, and can only do limited testing. I didn't have any intention to put the blame on you and I'm sorry that I couldn't keep my sarcasm to myself. |
Please note that FreeBSD bug report 208102 has been raised to include the proposed patch in the FreeBSD mc 4.8.16 packages. |
Branch: 2742_csh_as_tcsh_fix
I'm not a huge fan this whole detection business, but the patch seems to work for FreeBSD users, so I think we should include this in the next release. |
|
|
Important
This issue was migrated from Trac:
kriegaex
(Alexander@….name)pahan@….info
(@Hubbitus)This patch is related to a thread on mc-devel. I am copying the main part of my previous post to this ticket because I was asked to create one:
Note
Original attachments:
kriegaex
(Alexander@….name) onMar 8, 2012 at 11:30 UTC
kriegaex
(Alexander@….name) onMar 8, 2012 at 11:32 UTC
kriegaex
(Alexander@….name) onMar 8, 2012 at 11:33 UTC
er13
(ernews@….de) onApr 6, 2013 at 13:57 UTC
er13
(ernews@….de) onApr 6, 2013 at 13:57 UTC
er13
(ernews@….de) onApr 6, 2013 at 13:57 UTC
zaytsev-work
(@zyv) onMar 16, 2016 at 14:00 UTC
The text was updated successfully, but these errors were encountered: