Skip to content

[2.x] fix: Fixes --no-colors setting for sbtn#8517

Merged
eed3si9n merged 1 commit intosbt:developfrom
gayanMatch:fix/client-no-colors-option-7663
Jan 13, 2026
Merged

[2.x] fix: Fixes --no-colors setting for sbtn#8517
eed3si9n merged 1 commit intosbt:developfrom
gayanMatch:fix/client-no-colors-option-7663

Conversation

@gayanMatch
Copy link
Copy Markdown
Contributor

Fix client options like --no-colors being ignored

Problem

When running sbt with the client-server mode, client options like --no-colors are ignored. The server uses its own color settings instead of respecting each client's preferences.

Related issues: #7663, #6468

Solution

In Terminal.TerminalImpl.doWrite(), the code was using global singleton properties (Terminal.isAnsiSupported, Terminal.isColorEnabled) instead of the instance's properties (self.isAnsiSupported, self.isColorEnabled).

The NetworkTerminal correctly fetches the client's color settings via terminalPropertiesQuery, but these settings were never used when formatting output because doWrite() checked the global singleton.

Changes

  • Modified Terminal.TerminalImpl.doWrite() to use self.isColorEnabled and self.isAnsiSupported instead of Terminal.isColorEnabled and Terminal.isAnsiSupported
  • Added unit tests to verify terminal instances use their own color settings

Fixes #7663


Contribution by Gittensor, see my contribution statistics at https://gittensor.io/miners/details?githubId=132382032

@gayanMatch
Copy link
Copy Markdown
Contributor Author

@eed3si9n Could you please review my PR? And I'm not sure why one workflow run got failed. I think it's not related to my change, could you re-run it?

@eed3si9n
Copy link
Copy Markdown
Member

Does each terminal have its own color setting? afaik sbtn just sends each character to the sbt server, like ssh.

https://github.com/sbt/sbt/blob/develop/contributing-docs/01_pull_request.md#instruction-to-build-sbtn has an instruction on how to build sbtn locally. Could you post a screenshot of a local build with color turned on or off different from that of the server?

@gayanMatch gayanMatch force-pushed the fix/client-no-colors-option-7663 branch from e2201b9 to dd2c943 Compare January 13, 2026 19:15
@gayanMatch
Copy link
Copy Markdown
Contributor Author

Does each terminal have its own color setting? afaik sbtn just sends each character to the sbt server, like ssh.

https://github.com/sbt/sbt/blob/develop/contributing-docs/01_pull_request.md#instruction-to-build-sbtn has an instruction on how to build sbtn locally. Could you post a screenshot of a local build with color turned on or off different from that of the server?

Here are the results:

  • with colors:
image
  • without colors:
image

Copy link
Copy Markdown
Member

@eed3si9n eed3si9n left a comment

Choose a reason for hiding this comment

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

Thanks!

@eed3si9n eed3si9n changed the title fix: Use instance color settings instead of global singleton [2.x] fix: Fixes --no-colors setting for sbtn Jan 13, 2026
@eed3si9n eed3si9n merged commit 88e2f27 into sbt:develop Jan 13, 2026
14 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[2.x] Distinguish between client and server options

2 participants