fix: read -e -i stores into variable directly, not stdout
gates / consistency-and-conventions (push) Successful in 2m34s
gates / consistency-and-conventions (push) Successful in 2m34s
edited="\$(read ...)" was always empty because read writes to a variable name, not stdout. Changed to: read -e -p "Command: " -i "\$flat" edited which stores directly into \$edited.
This commit is contained in:
+1
-1
@@ -411,7 +411,7 @@ _inject_command() {
|
||||
if [ -w /dev/tty ]; then
|
||||
local edited=""
|
||||
printf '\n' >&2
|
||||
if edited="$(read -e -p "Command: " -i "$flat" </dev/tty 2>/dev/null)"; then
|
||||
if read -e -p "Command: " -i "$flat" edited </dev/tty 2>/dev/null; then
|
||||
[ -n "$edited" ] || { printf '%s\n' "Empty command — skipped." >&2; return 0; }
|
||||
printf '%s\n' "$edited"
|
||||
run eval "$edited"
|
||||
|
||||
Reference in New Issue
Block a user