mirror of
https://github.com/frebib/dotfiles.git
synced 2024-06-14 12:57:23 +00:00
Fix _dsh being interrupted by keyboard input, closing stdin
This commit is contained in:
parent
001a0f23ec
commit
8a3fd3c61a
4
aliases
4
aliases
@ -189,7 +189,7 @@ _dsh() {
|
|||||||
usercmd="--user=$user "
|
usercmd="--user=$user "
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ "$dowhat" = 'exec' -a -z "$(docker ps -q -f name="$host")" ]; then
|
if [ "$dowhat" = 'exec' -a -z "$(docker ps -q -f name="$host")" <&- ]; then
|
||||||
echo "No such container $host" >&2
|
echo "No such container $host" >&2
|
||||||
return 5
|
return 5
|
||||||
fi
|
fi
|
||||||
@ -197,7 +197,7 @@ _dsh() {
|
|||||||
if [ -z "$prog" ]; then
|
if [ -z "$prog" ]; then
|
||||||
set -o pipefail
|
set -o pipefail
|
||||||
for shell in bash sh; do
|
for shell in bash sh; do
|
||||||
if shell_path="$(eval "docker $dowhat -ti $host which $shell" | sed 's|[\r\n]||g')"; then
|
if shell_path="$(eval "docker $dowhat $rm $host which $shell" <&- | sed 's|[\r\n]||g')"; then
|
||||||
prog="$shell_path"
|
prog="$shell_path"
|
||||||
break
|
break
|
||||||
fi
|
fi
|
||||||
|
Loading…
Reference in New Issue
Block a user