Skip to content

Commit 057bae4

Browse files
committed
do not turn monitoring on/off in non interactive shells
(that's the set -m / set +m option)
1 parent 6677a56 commit 057bae4

File tree

6 files changed

+6
-6
lines changed

6 files changed

+6
-6
lines changed

missions/processes/01_ps_kill/clean.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,5 @@ echo $GSH_LAST_ACTION
44
kill -9 "$(cat "$GSH_TMP/spell.pid")" 2>/dev/null
55
my_ps | awk '/sleep|tail/ {print $1}' | xargs kill -9 2>/dev/null
66

7-
set -o monitor # monitor background processes (default)
7+
[ -n "$GSH_NON_INTERACTIVE" ] || set -o monitor # monitor background processes (default)
88
rm -f "$GSH_TMP/spell.pid" "$GSH_TMP/$(gettext "spell")"

missions/processes/01_ps_kill/init.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ _mission_init() {
5050
return 0
5151
}
5252

53-
set +o monitor # do not monitor background processes
53+
[ -n "$GSH_NON_INTERACTIVE" ] || set +o monitor # do not monitor background processes
5454
# FIXME: for some unknown reason, this doesn't work if we start with this
5555
# mission directly!
5656

missions/processes/02_ps_kill_signal/clean.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,4 @@ kill -9 $(cat "$GSH_TMP/spell.pids" 2>/dev/null) 2>/dev/null
55
my_ps | awk '/sleep|tail/ {print $1}' | xargs kill -9 2>/dev/null
66
rm -f "$GSH_TMP/spell-term.pids" "$GSH_TMP/spell.pids" "$GSH_TMP/$(gettext "spell")"
77

8-
set -o monitor # monitor background processes (default)
8+
[ -n "$GSH_NON_INTERACTIVE" ] || set -o monitor # monitor background processes (default)

missions/processes/02_ps_kill_signal/init.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ _mission_init() {
6464
return 0
6565
}
6666

67-
set +o monitor # do not monitor background processes
67+
[ -n "$GSH_NON_INTERACTIVE" ] || set +o monitor # do not monitor background processes
6868
# FIXME: for some unknown reason, this doesn't work if we start with this
6969
# mission directly!
7070

missions/processes/03_pstree_kill/clean.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -21,4 +21,4 @@ rm -f "$GSH_TMP/$(gettext "mischievous_imp")"
2121
find . -name "*_$(gettext "snowflake")" | sed '1,10d' | xargs rm -f
2222
find . -name "*_$(gettext "coal")" | xargs rm -f
2323
)
24-
set -o monitor # monitor background processes (default)
24+
[ -n "$GSH_NON_INTERACTIVE" ] || set -o monitor # monitor background processes (default)

missions/processes/03_pstree_kill/init.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ _mission_init() {
9797
return 0
9898
}
9999

100-
set +o monitor # do not monitor background processes
100+
[ -n "$GSH_NON_INTERACTIVE" ] || set +o monitor # do not monitor background processes
101101
# FIXME: for some unknown reason, this doesn't work if we start with this
102102
# mission directly!
103103

0 commit comments

Comments
 (0)