-
Notifications
You must be signed in to change notification settings - Fork 80
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
docs: add truecolor info #273
base: main
Are you sure you want to change the base?
Conversation
README.md
Outdated
@@ -162,8 +162,6 @@ useradd --system --user-group --create-home myapp | |||
|
|||
That should do it. | |||
|
|||
### |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
oh HA, I can add this back in. I thought I had accidentally added this
docs/truecolor.md
Outdated
terminal for support if `COLORTERM` is not detected. | ||
|
||
> [!NOTE] | ||
> Wish uses [termenv][termenv] under the hood, which will set truecolor for a few |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't even know if this sentence makes sense 😂 may need a lil tidy later
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think the chain of deps is more like wish -> lipgloss -> termenv
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
going to leave this part out for now given we're going to intro term changes soon which might include different default behaviour
docs/truecolor.md
Outdated
terminal for support if `COLORTERM` is not detected. | ||
|
||
> [!NOTE] | ||
> Wish uses [termenv][termenv] under the hood, which will set truecolor for a few |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
> Wish uses [termenv][termenv] under the hood, which will set truecolor for a few | |
> Wish uses [termenv][termenv] under the hood, which will set `truecolor` for a few |
docs/truecolor.md
Outdated
|
||
`CLICOLOR_FORCE` - overrides `CLICOLOR`. | ||
|
||
NO_COLOR vs CLICOLOR: if NO_COLOR is set or CLICOLOR=0 then the output should |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
NO_COLOR vs CLICOLOR: if NO_COLOR is set or CLICOLOR=0 then the output should | |
`NO_COLOR` vs `CLICOLOR`: if `NO_COLOR `is set or `CLICOLOR=0` then the output should |
I know this might not be the ideal place to ask, but I’m lost and desperate for a solution. We have a Wish application that displays colors perfectly when run locally. Setting environment variables like NO_COLOR or CLICOLOR=0 correctly disables the colors as expected. However, when I deploy this Wish application to the server, it doesn’t display any colors. I’ve tried the following steps without success:
Despite these efforts, the application still doesn’t display colors when run on a server. Any advice on what else I could try to resolve this issue would be greatly appreciated. This description is more concise and clearly states the problem and the steps you’ve already taken to try to resolve it. |
@tartavull I successfully made the bubbletea example (PS: need to serve it on 0.0.0.0 instead of localhost) work inside a container (with no colors, as you can see in the log), and clients got colors anyway: The trick is to use a custom renderer for your lipgloss colors. By default, it'll use the one from the current environment, which in this case is the server, not the client. So we need to make a new renderer using the client's info and use it instead. See wish/examples/bubbletea/main.go Line 81 in 43884f7
Hope that helps. We should probably document this, too. All this should be improved in the v2 stack of everything. |
fwiw @bashbunni I pushed some updates I think we should probably merge this |
@caarlos0 I read everything, tried to understand, but still couldn't.. If the colors are there when running locally, then why we can't do anything on a server/in a container so that they are there? Also locally, locally for the server, why is this not possible? I have full featured application and I don't want rewrite full application and redefine all styles of external components (bubbles) with some custom renderer.. Besides deep-alpha v2, is there really no option at all? |
@@ -116,10 +116,11 @@ Host localhost | |||
## How it works? | |||
|
|||
Wish uses [gliderlabs/ssh][gliderlabs/ssh] to implement its SSH server, and |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fwiw, we maintain our own fork of gliderlabs/ssh and this library only provides abstractions on top of Golang's SSH implementation
Wish uses [gliderlabs/ssh][gliderlabs/ssh] to implement its SSH server, and | |
Wish uses [crypto/ssh](https://pkg.go.dev/golang.org/x/crypto/ssh) and [gliderlabs/ssh][gliderlabs/ssh] to implement its SSH server, and |
It's more complicated than how it seems. When you connect to an SSH server interactively, the SSH server daemon is responsible for opening a terminal, or a PTY, for the session to operate normally and run in a real terminal. During the connection initialization, and for security reasons, both the For colors to work correctly, we need to send local terminal color environment variables such as With the v2 stack, you can allocate real terminals and PTYs using the
You shouldn't rewrite and redefine styles and components. Bubble Tea and Lip Gloss v2 doesn't change much of the API and mainly focus on internal implementation. If you're using This is because with |
But @tartavull said above, that there are no colors even with this variable sending.. Is this exactly enough for the v1 running on a server to show colors to the client? |
Not sure if this should live in the README or in a dedicated docs section...
Will figure that out before merging. A review on the content itself would be
appreciated!