File tree Expand file tree Collapse file tree 1 file changed +8
-3
lines changed
Expand file tree Collapse file tree 1 file changed +8
-3
lines changed Original file line number Diff line number Diff line change 284284docker_compose () {
285285 local command=" $1 "
286286 shift
287- local command_options=" "
287+ local command_options=()
288288
289289 # We must pass "-T" to docker-compose exec when piping input
290290 if [ " $command " = " exec" ] && [ ! -t 0 ]; then
291- command_options=" -T"
291+ command_options+=(-T)
292+ fi
293+
294+ # Set screen size
295+ if [[ " $command " =~ exec| run ]]; then
296+ command_options+=(-e COLUMNS=$( tput cols) -e LINES=$( tput lines) )
292297 fi
293298
294299 # Note: Apparently, using --project-directory or --file options for `docker-compose` will break use of `$PWD` in
295300 # docker-compose.yml. Therefore, we `cd` before running `docker-compose` command.
296- (cd " $docker_compose_dir " && COMPOSE_DOMAIN=${COMPOSE_DOMAIN} docker-compose " $command " $command_options " $@ " )
301+ (cd " $docker_compose_dir " && COMPOSE_DOMAIN=${COMPOSE_DOMAIN} docker-compose " $command " ${ command_options[@] : + ${command_options[@]} } " $@ " )
297302}
298303
299304cmd=" $1 "
You can’t perform that action at this time.
0 commit comments