Created
March 29, 2018 13:17
-
-
Save Gordin/e5814eaf595a99836aa8ace33684a3f8 to your computer and use it in GitHub Desktop.
Docker exec with correct Terminal size
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
dexec(){ | |
CONTAINER=$1 | |
shift | |
docker exec -it $CONTAINER bash -c "stty cols $COLUMNS rows $LINES && $*"; | |
} | |
_dexec(){ | |
COMPREPLY=( $(docker ps --format "{{.Names}}" -f name=$2) ); | |
} | |
complete -F _dexec dexec; | |
export dexec; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment