diff --git a/4258-fish-subshell-prompt.patch b/4258-fish-subshell-prompt.patch new file mode 100644 index 0000000..cd6ef22 --- /dev/null +++ b/4258-fish-subshell-prompt.patch @@ -0,0 +1,15 @@ +--- + src/subshell/common.c | 6 +++--- + 1 file changed, 3 insertions(+), 3 deletions(-) + +--- a/src/subshell/common.c ++++ b/src/subshell/common.c +@@ -713,7 +713,7 @@ parse_subshell_prompt_string (const char + + /* Extract the prompt from the shell output */ + for (i = 0; i < bytes; i++) +- if (buffer[i] == '\n' || buffer[i] == '\r') ++ if (buffer[i] == '\n') + g_string_set_size (subshell_prompt_temp_buffer, 0); + else if (buffer[i] != '\0') + g_string_append_c (subshell_prompt_temp_buffer, buffer[i]); diff --git a/mc.changes b/mc.changes index a2e2aa9..c17575d 100644 --- a/mc.changes +++ b/mc.changes @@ -1,3 +1,16 @@ +------------------------------------------------------------------- +Mon Jun 27 19:36:16 UTC 2022 - Matej Cepl + +- Include review comments: don't depend on fish. + +------------------------------------------------------------------- +Wed Jun 15 15:05:02 UTC 2022 - Matej Cepl + +- Add 4258-fish-subshell-prompt.patch fixing + https://midnight-commander.org/ticket/4258 stopping fish from sending + \r while printing prompt and mc erases prompt buffer. +- Add mc.fish, which the fish equivalent of /usr/share/mc/mc-wrapper.sh + ------------------------------------------------------------------- Sun Mar 27 19:39:05 UTC 2022 - Andreas Stieger diff --git a/mc.fish b/mc.fish new file mode 100644 index 0000000..affeabe --- /dev/null +++ b/mc.fish @@ -0,0 +1,25 @@ +function mc --description='Midnight Commander' + set -q TMPDIR || set -gx TMPDIR /tmp + set -gx _fish_MC_PWD_FILE $TMPDIR/mc-(id -un)/mc.pwd.$fish_pid + command mc -P "$_fish_MC_PWD_FILE" $argv + + if test -r $_fish_MC_PWD_FILE + set -gx _fish_MC_PWD (cat $_fish_MC_PWD_FILE) + if test -n $_fish_MC_PWD && test $_fish_MC_PWD != $PWD && test -d $_fish_MC_PWD + cd $_fish_MC_PWD + end + set -e _fish_MC_PWD + end + + set -e _fish_MC_PWD_FILE + set -e _fish_MC_USER + + function _remove_tmp --on-job-exit caller --inherit-variable _fish_MC_PWD_FILE + command rm $_fish_MC_PWD_FILE + set -f dirn (dirname $_fish_MC_PWD_FILE) + if test -d "$dirn" + rm -f $dirn + end + functions -e _remove_tmp + end +end diff --git a/mc.spec b/mc.spec index b08ff0c..c76cc6d 100644 --- a/mc.spec +++ b/mc.spec @@ -29,6 +29,7 @@ Source2: %{name}.desktop Source3: %{name}.png Source4: cmake.syntax Source6: http://ftp.midnight-commander.org/%{name}-%{version}.sha256 +Source7: mc.fish Patch0: mc-fix_lib_search_path.patch Patch12: mc-wrapper.patch Patch16: mc-esc-seq.patch @@ -44,6 +45,9 @@ Patch23: mc-extfs-iso9660-xorriso.patch Patch32: 20_wrong_path_to_wrappers.patch # PATCH-FIX-UPSTREAM mc-multi-press-f-keys.patch mc287 sbrabec@suse.cz - Fixed Esc + Numeral F-key emulation. Patch41: mc-multi-press-f-keys.patch +# PATCH-FIX-UPSTREAM 4258-fish-subshell-prompt.patch https://midnight-commander.org/ticket/4258 mcepl@suse.com +# don't send \r while printing prompt +Patch42: 4258-fish-subshell-prompt.patch # Patches from Fedora #Patch adding -fpie and -pie to compilation and linking of setuid binaries Patch52: mc-pie.patch @@ -69,6 +73,7 @@ BuildRequires: xorg-x11-devel BuildRequires: xz Requires(pre): permissions Recommends: %{name}-lang = %{version} +Enhances: fish Recommends: mkisofs Recommends: xorriso @@ -105,10 +110,12 @@ echo "`grep %{name}-%{version}.tar.xz %{SOURCE6} | head -n1 | cut -c1-64` %{SOU %patch23 %patch32 %patch41 -p1 +%patch42 -p1 %patch52 -p1 %patch100 -p1 %build +%{?!make_build:%define make_build make -O %_smp_mflags V=1 VERBOSE=1} autoreconf -fvi %define warn_flags -W -Wall -Wstrict-prototypes -Wpointer-arith -Wformat-security -Wno-unused-parameter export CFLAGS="%{optflags} %{warn_flags}" @@ -140,6 +147,10 @@ install -m 755 %{SOURCE1} %{buildroot}%{_datadir}/mc/ install -D -m 644 %{SOURCE3} %{buildroot}%{_datadir}/pixmaps/%{name}.png install -D -m 644 %{SOURCE3} %{buildroot}%{_datadir}/icons/hicolor/32x32/apps/%{name}.png +# Fish wrapper script +install -D -m 644 %{SOURCE7} \ + %{buildroot}%{_datadir}/fish/vendor_functions.d/mc.fish + for f in ext.d/misc.sh ext.d/sound.sh ext.d/video.sh \ extfs.d/gitfs+ extfs.d/uace extfs.d/uarc ; do @@ -193,6 +204,10 @@ rm -rf %{buildroot}%{_datadir}/locale/be@tarask %exclude %{_datadir}/mc/help/mc.hlp.* %exclude %{_datadir}/locale/*/LC_MESSAGES/mc.mo +%dir %{_datadir}/fish +%dir %{_datadir}/fish/vendor_functions.d +%{_datadir}/fish/vendor_functions.d/mc.fish + %{_datadir}/applications/%{name}.desktop %{_datadir}/pixmaps/%{name}.png %dir %{_datadir}/icons/hicolor