From 920dec0cedc31cc93946fe9a71eaa4d0790a793c Mon Sep 17 00:00:00 2001 From: mviereck Date: Mon, 21 Jan 2019 15:05:55 +0100 Subject: [PATCH] --interactive on Windows: Add winpty if available #87 --- x11docker | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/x11docker b/x11docker index 8c023a88..a94f9520 100755 --- a/x11docker +++ b/x11docker @@ -4208,7 +4208,13 @@ create_dockerrc() { # create dockerrc: This script runs as root (or echo "read Containerid < <($Dockercommand 2>>$Containerlogfile | rmcr)" ;; yes) - echo "$Dockercommand <&0 &" + [ "$Winsubsystem" ] && { + Winpty="$(command -v winpty)" + [ "$Winpty" ] || warning "Option -i, --interactive: On MS Windows you need winpty + for an interactive tty. MSYS2 provides it as a package. + On Cygwin it can be compiled from source. WSL isn't supported yet." + } + echo "$Winpty $Dockercommand <&0 &" echo "Containerid=$Containername" ;; esac @@ -6197,6 +6203,7 @@ declare_variables() { # declare global variables Winsubmount="" # path within subsystem to mounted Windows drives Winsubpath="" # path within Windows to subsystem files Winpidlist="" # List of stored Windows pids (currently vcxsrv.exe on WSL only) + Winpty="" # Path to winpty for --interactive on Windows # Gaining root privileges to run docker Passwordfrontend="" # --pw: method to prompt for password. one of pkexec, su, sudo, gksu, gksudo, kdesu, kdesudo, lxsu, lxsudo, beesu, auto, none