File tree Expand file tree Collapse file tree 4 files changed +10
-1
lines changed
Expand file tree Collapse file tree 4 files changed +10
-1
lines changed Original file line number Diff line number Diff line change @@ -36,6 +36,8 @@ Modules 5.6.0 (not yet released)
3636* Doc: add :ref: `add-new-maintainer ` guide
3737* Fix interpreter variable reset between multiple modulefile or modulerc
3838 evaluations when variable initial value is an invalid list. (fix issue #570)
39+ * Fix :mfcmd: `source-sh ` and :subcmd: `sh-to-mod ` shell translation when used
40+ with new *fish * shell version (4.0).
3941
4042.. _Security policy : https://github.com/envmodules/modules/blob/main/SECURITY.md
4143.. _Modules chat room : https://matrix.to/#/#modules:matrix.org
Original file line number Diff line number Diff line change @@ -1486,7 +1486,7 @@ proc execShAndGetEnv {elt_ignored_list shell script args} {
14861486 shell $shdesc ] 2>&1; or exit \$ status; echo '$sep '; set -xgL;\
14871487 echo '$sep '; $getfunc ; string split \$ funcout; echo '$sep ';\
14881488 string split \$ funcout; echo '$sep '; complete; echo '$sep '; pwd"
1489- set varre {^(\S +?\M ) ?' ?(.*?)' ?$}
1489+ set varre {^(\S +?\M ) ?[' " ] ?(.*?)[ ' " ] ?$}
14901490 # exclude alias from function list
14911491 set funcre " ^function (\\ S+?)(?: \[ ^\\ n\] *?--description\
14921492 (?!'?alias)\[ ^\\ n\] +)?\\ n(.+?)?\\ s*\\ nend\\ n$subsep \$ "
Original file line number Diff line number Diff line change @@ -102,6 +102,7 @@ if {[set fishbin [lindex [auto_execok fish] 0]] ne {}} {
102102 regexp {version (.+)$} [exec $fishbin --version] match fish_version
103103 set fish_version_ge31 [expr {[lindex [lsort -dictionary [list $fish_version 3.1.0]] 0] eq {3.1.0}}]
104104 set fish_version_ge32 [expr {[lindex [lsort -dictionary [list $fish_version 3.2.0]] 0] eq {3.2.0}}]
105+ set fish_version_ge40 [expr {[lindex [lsort -dictionary [list $fish_version 4.0.0]] 0] eq {4.0.0}}]
105106}
106107
107108# find ksh flavor
Original file line number Diff line number Diff line change @@ -226,9 +226,15 @@ set tscomp_tcsh "complete\ttcsh cmd {'n/-h/n/' 'n/--help/n/' 'n/-V/n/' 'n/--vers
226226complete\ttcsh mycmd {'n/help/`_module_avail`/' 'n/add/`_module_not_yet_loaded; echo \"--auto --no-auto --force -f --icase -i --tag --tag=\"`/'}
227227complete\ttcsh othercmd 'n/--help/n/'"
228228if {[info exists fish_version_ge31] && $fish_version_ge31} {
229+ if {[info exists fish_version_ge40] && $fish_version_ge40} {
230+ set tscomp_alias_fish "complete\tfish alcb --wraps\\ 'echo\\ f\\\\\\\\\\\{o'
231+ complete\tfish alfoo {--wraps 'echo (grep \"report .Modules \" ../../modulecmd.tcl | tr -d \\\\\\\\ 2>/dev/null | awk \\'{print \$3}\\')'}
232+ complete\tfish alsp {--wraps 'echo f\\\\\"o; echo b\\\\\\\\\\\\\"r; echo f\\\\\\'o'}"
233+ } else {
229234set tscomp_alias_fish "complete\tfish alcb {--wraps echo\\ f\\\\\\\{o}
230235complete\tfish alfoo {--wraps echo\\ \\(grep\\ \\\"report\\ .Modules\\ \\\"\\ ../../modulecmd.tcl\\ \\|\\ tr\\ -d\\ \\\\\\\\\\ 2\\>/dev/null\\ \\|\\ awk\\ \\'\\{print\\ \\\$3\\}\\'\\)}
231236complete\tfish alsp {--wraps echo\\ f\\\\\\\"o\\;\\ echo\\ b\\\\\\\\\\\\\\\"r\\;\\ echo\\ f\\\\\\'o}"
237+ }
232238set tscomp_fish "complete\tfish cmd {-l help -d 'Command help'}
233239complete\tfish cmd {-l version -d 'Command version'}
234240complete\tfish cmd {-s h -d 'Command help'}
You can’t perform that action at this time.
0 commit comments