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

Commit

Permalink
Have vagrant ssh as a backup option for dsh bash on Windows
Browse files Browse the repository at this point in the history
Fall back to vagrant ssh if winpty is not installed
  • Loading branch information
lmakarov committed Apr 15, 2016
1 parent 06d21d6 commit d17c565
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions bin/dsh
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/bin/bash

DSH_VERSION=1.12.9
DSH_VERSION=1.12.10

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

0 comments on commit d17c565

Please sign in to comment.