Skip to content
This repository was archived by the owner on Dec 1, 2018. It is now read-only.

Commit d17c565

Browse files
author
Leonid Makarov
committed
Have vagrant ssh as a backup option for dsh bash on Windows
Fall back to vagrant ssh if winpty is not installed
1 parent 06d21d6 commit d17c565

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

bin/dsh

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#!/bin/bash
22

3-
DSH_VERSION=1.12.9
3+
DSH_VERSION=1.12.10
44

55
# Console colors
66
red='\033[0;31m'
@@ -968,7 +968,10 @@ _bash ()
968968
# Workaround - run docker via winpty (console.exe) to get a tty console in cygwin.
969969
console docker exec -it $container_id bash -i
970970
else
971-
docker exec -it $container_id bash -i
971+
# Drop /cygdrive prefix if the working directory is opened as /cygdrive/<driveletter>/.. instead of /<driveletter>..
972+
cwd=$(pwd); cwd=${cwd#/cygdrive}
973+
command="cd $cwd && docker exec -it $container_id bash -i";
974+
vagrant ssh -c "$command"
972975
fi
973976
fi
974977
}

0 commit comments

Comments
 (0)