Skip to content

Restore correct terminal with to interactive breeze usage#14579

Merged
ashb merged 2 commits intoapache:masterfrom
astronomer:restore-correct-terminal-width-breeze
Mar 4, 2021
Merged

Restore correct terminal with to interactive breeze usage#14579
ashb merged 2 commits intoapache:masterfrom
astronomer:restore-correct-terminal-width-breeze

Conversation

@ashb
Copy link
Member

@ashb ashb commented Mar 3, 2021

The change to redirect all breeze output to a file (#14470) had the effect of making stdin no longer a TTY, which meant that the docker container had a fixed with of 80 columns.

The fix is to replace the use of tee with scripts, which does what we want -- captures stdout+stderr, but makes the running program believe that it is still attached to a terminal (if it ever was).

Tested with ./breeze -n shell -- -c 'set -x; [[ $(tput cols) -gt 80 ]]'

@ashb ashb requested a review from potiuk as a code owner March 3, 2021 12:39
@ashb ashb requested a review from kaxil March 3, 2021 12:39
@ashb ashb marked this pull request as draft March 3, 2021 14:34
@ashb
Copy link
Member Author

ashb commented Mar 3, 2021

The script command on OSX may be slightly different. Testing.

@potiuk
Copy link
Member

potiuk commented Mar 3, 2021

Yep. It's tricky with 'Posix-ish' level of support on MacOS

@ashb
Copy link
Member Author

ashb commented Mar 3, 2021

Just updating brew on my mac laptop to test out a fix.

@github-actions
Copy link

github-actions bot commented Mar 3, 2021

The PR most likely needs to run full matrix of tests because it modifies parts of the core of Airflow. However, committers might decide to merge it quickly and take the risk. If they don't merge it quickly - please rebase it to the latest master at your convenience, or amend the last commit of the PR, and push it with --force-with-lease.

@github-actions github-actions bot added the full tests needed We need to run full set of tests for this PR to merge label Mar 3, 2021
ashb added 2 commits March 4, 2021 11:46
The change to redirect all breeze output to a file had the effect of
making stdin no longer a TTY, which meant that the docker container had
a fixed with of 80 columns.

The fix is to replace the use of `tee` with `scripts`, which does what
we want -- captures stdout+stderr, but makes the running program believe
that it is still attached to a terminal (if it ever was).
@ashb ashb force-pushed the restore-correct-terminal-width-breeze branch from 58ef856 to 6a3ce31 Compare March 4, 2021 11:47
@ashb
Copy link
Member Author

ashb commented Mar 4, 2021

@kaxil Updated -- could you confirm this works for you on OSX please?

@ashb ashb marked this pull request as ready for review March 4, 2021 11:47
Copy link
Member

@kaxil kaxil left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Confirmed works fine

@ashb
Copy link
Member Author

ashb commented Mar 4, 2021

Will merge without CI -- this doesn't affect them anyway.

@ashb ashb merged commit 4c1e3c8 into apache:master Mar 4, 2021
@ashb ashb deleted the restore-correct-terminal-width-breeze branch March 4, 2021 14:59
potiuk added a commit to potiuk/airflow that referenced this pull request Mar 15, 2021
The BASH variable introduced in apache#14579 is not set when the main shell is
zsh on MacOS (which is the default) this PR changes it so that the
output of `command -v bash` is used instead.

Fixes apache#14754
potiuk added a commit that referenced this pull request Mar 15, 2021
The BASH variable introduced in #14579 is not set when the main shell is
zsh on MacOS (which is the default) this PR changes it so that the
output of `command -v bash` is used instead.

Fixes #14754
potiuk pushed a commit that referenced this pull request Mar 23, 2021
The change to redirect all breeze output to a file had the effect of
making stdin no longer a TTY, which meant that the docker container had
a fixed with of 80 columns.

The fix is to replace the use of `tee` with `scripts`, which does what
we want -- captures stdout+stderr, but makes the running program believe
that it is still attached to a terminal (if it ever was).

(cherry picked from commit 4c1e3c8)
potiuk added a commit that referenced this pull request Mar 23, 2021
The BASH variable introduced in #14579 is not set when the main shell is
zsh on MacOS (which is the default) this PR changes it so that the
output of `command -v bash` is used instead.

Fixes #14754

(cherry picked from commit c613384)
ashb added a commit that referenced this pull request Apr 15, 2021
The change to redirect all breeze output to a file had the effect of
making stdin no longer a TTY, which meant that the docker container had
a fixed with of 80 columns.

The fix is to replace the use of `tee` with `scripts`, which does what
we want -- captures stdout+stderr, but makes the running program believe
that it is still attached to a terminal (if it ever was).

(cherry picked from commit 4c1e3c8)
ashb pushed a commit that referenced this pull request Apr 15, 2021
The BASH variable introduced in #14579 is not set when the main shell is
zsh on MacOS (which is the default) this PR changes it so that the
output of `command -v bash` is used instead.

Fixes #14754

(cherry picked from commit c613384)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:dev-tools full tests needed We need to run full set of tests for this PR to merge

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants