Skip to content

Commit

Permalink
Improve terminal logic
Browse files Browse the repository at this point in the history
  • Loading branch information
ofek committed Oct 8, 2023
1 parent 6a1f8dc commit 894db4d
Show file tree
Hide file tree
Showing 5 changed files with 4 additions and 11 deletions.
3 changes: 0 additions & 3 deletions .github/workflows/docs-dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,6 @@ on:
concurrency:
group: docs-deploy

env:
FORCE_COLOR: "1"

jobs:
build:
runs-on: ubuntu-latest
Expand Down
3 changes: 0 additions & 3 deletions .github/workflows/docs-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,6 @@ on:
concurrency:
group: docs-deploy

env:
FORCE_COLOR: "1"

jobs:
build:
runs-on: ubuntu-latest
Expand Down
1 change: 0 additions & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ concurrency:
env:
STABLE_PYTHON_VERSION: '3.11'
PYTHONUNBUFFERED: "1"
FORCE_COLOR: "1"

jobs:
run:
Expand Down
4 changes: 2 additions & 2 deletions src/hatch/cli/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -102,8 +102,8 @@ def hatch(ctx: click.Context, env_name, project, verbose, quiet, color, interact
elif os.environ.get(AppEnvVars.FORCE_COLOR) == '1':
color = True

if interactive is None:
interactive = not running_in_ci()
if interactive is None and running_in_ci():
interactive = False

app = Application(ctx.exit, verbose - quiet, color, interactive)

Expand Down
4 changes: 2 additions & 2 deletions src/hatch/cli/terminal.py
Original file line number Diff line number Diff line change
Expand Up @@ -136,8 +136,8 @@ def __init__(self, verbosity, enable_color, interactive):
self.verbosity = verbosity
self.interactive = interactive
self.console = Console(
force_terminal=enable_color,
no_color=enable_color is False,
force_interactive=interactive,
no_color=None if enable_color is None else not enable_color,
markup=False,
emoji=False,
highlight=False,
Expand Down

0 comments on commit 894db4d

Please sign in to comment.