Skip to content

Commit

Permalink
--interactive on MS Windows: Exit with error if winpty is missing #217
Browse files Browse the repository at this point in the history
  • Loading branch information
mviereck committed Jan 29, 2020
1 parent 20da640 commit e55fdfe
Showing 1 changed file with 14 additions and 14 deletions.
28 changes: 14 additions & 14 deletions x11docker
Original file line number Diff line number Diff line change
Expand Up @@ -440,8 +440,9 @@ ${Colredbg}x11docker ERROR:${Colnorm} $Message
}
logentry() { # write into logfile
[ -e "$Logfile" ] && {
[ "$Logmessages" ] && echo "$Logmessages" >>$Messagelogfile 2>/dev/null && Logmessages=""
[ -n "$Logmessages" ] && echo "$Logmessages" >>$Messagelogfile 2>/dev/null && Logmessages=""
echo "$*" >>$Messagelogfile 2>/dev/null
:
} || Logmessages="$Logmessages
$*"
}
Expand Down Expand Up @@ -6762,6 +6763,16 @@ check_option_interferences() { # check multiple option interferences, change se
# --interactive
case $Interactive in
yes)
case $Winsubsystem in
MSYS2|CYGWIN|WSL1)
Winpty="$(command -v winpty)"
Winpty="$(escapestring "$Winpty")"
[ "$Winpty" ] || error "Option -i, --interactive: On MS Windows you need 'winpty'
to run x11docker in interactive mode. MSYS2 provides winpty as a package.
On Cygwin it can be compiled from source. WSL1 isn't supported yet.
WSL2 might work, but is not tested yet."
;;
esac
[ "$Forwardstdin" = "yes" ] && {
note "You cannot use --stdin along with --interactive.
Fallback: Disabling option --stdin."
Expand All @@ -6775,20 +6786,9 @@ check_option_interferences() { # check multiple option interferences, change se
}
case $Initsystem in
systemd|openrc|runit|sysvinit) note "Option --interactive: Interactive mode with option
--init=$Initsystem is not well integrated yet. Shells do not have job
control, and CTRL-C can behave different than expected." ;;
--init=$Initsystem is not well integrated yet.
Shells do not have job control and CTRL-C can behave different than expected." ;;
esac
[ "$Winsubsystem" ] && {
Winpty="$(command -v winpty)"
Winpty="$(escapestring "$Winpty")"
[ "$Winpty" ] || {
note "Option -i, --interactive: On MS Windows you need 'winpty'
to run x11docker in interactive mode. MSYS2 provides winpty as a package.
On Cygwin it can be compiled from source. WSL isn't supported yet.
Fallback: disabling option --interactive."
Interactive="no"
}
}
;;
esac
[ "$Interactive" = "yes" ] && Showcontaineroutput="no"
Expand Down

0 comments on commit e55fdfe

Please sign in to comment.