Skip to content

Commit 2e330aa

Browse files
committed
fix: Functions manually set REPLY now work with -P
1 parent 8cb83cb commit 2e330aa

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

pkg/src/public/bash-term.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,7 @@ term.cursor_savepos() {
150150
else
151151
REPLY=$'\e[s'
152152
fi
153-
[ "$flag_print" = 'yes' ] && printf '%s\n' "$REPLY"
153+
term.private_util_replyprint
154154
}
155155

156156
# @description Restores cursor to the last saved position
@@ -168,7 +168,7 @@ term.cursor_restorepos() {
168168
else
169169
REPLY=$'\e[u'
170170
fi
171-
[ "$flag_print" = 'yes' ] && printf '%s\n' "$REPLY"
171+
term.private_util_replyprint
172172
}
173173

174174
# FIXME: docs

pkg/src/util/util.sh

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -50,16 +50,16 @@ term.private_util_set_reply() {
5050
local value="$1"
5151

5252
REPLY="$value"
53-
if [ "$flag_print" = 'yes' ]; then
54-
printf '%s' "$REPLY"
55-
elif [ "$flag_print" = 'yes-newline' ]; then
56-
printf '%s\n' "$REPLY"
57-
fi
53+
term.private_util_replyprint
5854
}
5955

6056
term.private_util_set_reply2() {
6157
# shellcheck disable=SC2059
6258
printf -v REPLY "$@"
59+
term.private_util_replyprint
60+
}
61+
62+
term.private_util_replyprint() {
6363
if [ "$flag_print" = 'yes' ]; then
6464
printf '%s' "$REPLY"
6565
elif [ "$flag_print" = 'yes-newline' ]; then

0 commit comments

Comments
 (0)