Nov 30, 2018

More Docker Fun

Handy command pulled from SO to ensure when you enter a docker container, the terminal buffer size isn't 100% messed up:

https://stackoverflow.com/questions/38786615/docker-number-of-lines-in-terminal-changing-inside-docker/49281526#49281526

goinside(){
    docker exec -it $1 bash -c "stty cols $COLUMNS rows $LINES && bash";
}
_goinside(){
    COMPREPLY=( $(docker ps --format "{{.Names}}" -f name=$2) );
}
complete -F _goinside goinside;
export -f goinside;

No comments:

Post a Comment