-
-
Notifications
You must be signed in to change notification settings - Fork 21
Ticket #4726: add mc-wrapper
for fish shell
#4730
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
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
mc-wrapper.csh | ||
mc-wrapper.sh | ||
mc-wrapper.* | ||
!mc-wrapper.*.in | ||
mc.csh | ||
mc.fish | ||
mc.sh |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
set --local MC_PWD_FILE | ||
if set -q MC_TMPDIR | ||
set MC_PWD_FILE (mktemp $MC_TMPDIR/mc.pwd.XXXXXX) | ||
else if set -q TMPDIR | ||
set MC_PWD_FILE (mktemp $TMPDIR/mc.pwd.XXXXXX) | ||
else | ||
set MC_PWD_FILE (mktemp /tmp/mc.pwd.XXXXXX) | ||
end | ||
|
||
# Propagate mc exit code outside the wrapper | ||
@bindir@/mc -P "$MC_PWD_FILE" $argv | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. this will not actually propagate the exit code beyond line 13. diff --git a/contrib/mc-wrapper.sh.in b/contrib/mc-wrapper.sh.in
index 399b38a892..1a8200b5de 100644
--- a/contrib/mc-wrapper.sh.in
+++ b/contrib/mc-wrapper.sh.in
@@ -6,7 +6,8 @@
MC_PWD_FILE="`mktemp "/tmp/mc.pwd.XXXXXX"`"
fi
-@bindir@/mc -P "$MC_PWD_FILE" "$@" || true
+MC_STATUS=0
+@bindir@/mc -P "$MC_PWD_FILE" "$@" || MC_STATUS=$?
if test -r "$MC_PWD_FILE"; then
MC_PWD="`cat "$MC_PWD_FILE"`"
@@ -18,3 +19,4 @@
rm -f "$MC_PWD_FILE"
unset MC_PWD_FILE
+eval "unset MC_STATUS; exit $MC_STATUS" There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I guess the comment was written assuming |
||
|
||
if test -r "$MC_PWD_FILE" | ||
set --local MC_PWD (cat $MC_PWD_FILE) | ||
if test -n $MC_PWD && test $MC_PWD != $PWD && test -d $MC_PWD | ||
cd $MC_PWD || true | ||
end | ||
end | ||
|
||
rm -f $MC_PWD_FILE |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
function mc --description 'Visual shell for Unix-like systems - fish wrapper' | ||
source @pkglibexecdir@/mc-wrapper.fish $argv | ||
end |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
FWIW I intentionally did not include the fish lines in this commit because they belong in the commit that adds the referenced fish files.
Of course the advantage from the separate commit is fairly small here so both could be combined into a single commit also.