raphamorim / rio

A hardware-accelerated GPU terminal emulator focusing to run in desktops and browsers.
https://raphamorim.io/rio
MIT License
3.48k stars 111 forks source link

Rio ignoring config.toml on macOS 13.5.1 #202

Closed ehjmx closed 1 year ago

ehjmx commented 1 year ago

It seems as if Rio 0.0.18 is totally ignoring the configuration file config.toml.

It is placed unter ~/.config/rio/config.toml image

The font used is definitely not Fira Code. I tried it as "firacode" "FiraCode" "Fira Code" in the new font config section it has no affect.

The same goes for the Shell and Environment variables shell = { program = "/opt/local/bin/bash", args = ["--login"] } env-vars = ['SHELL=/opt/local/bin/bash']

Theme support seems to be broken as well as I see no difference in the appearance of Rio when setting or unsetting theme = "dracula"

What works is the font sitze.

While some of the settings where also ignored by 0.0.16 with the old config file format this is a huge step back and I was just about to use Rio as my every day terminal, now it seems to be back to Wezterm.

I attached my current config.toml as config.txt config.txt

Rio 0.0.18 and Canary - 8ebe062ed8b64bc49ae6868452c256ea488eaabf macOS 13.5.1 bash 5.2.15 installed via macports but /bin/bash that comes with macOS is also ignored Font: Fira Code Also tried Red Hat Mono, Victor Mono. Even Cascadia Mono out of the example for 0.0.17 doesn't seem to work.

Brianalmeida commented 1 year ago

Would you mind sharing your config.toml file?

There were some changes made to the config formatting in 0.0.17.

The docs also were updated to reflect these new changes.

Edit: I do see that FiraCode has a Terminal compatibility list, but I am not sure if that has anything to do with the first concern you had. Testing FiraCode and VictorMono on Linux, both font families do not work. Does JetBrains Mono work?

For the shell section, instead of /opt/local/bin/bash have you already tried /bin/bash?

ehjmx commented 1 year ago

Yes, I tried /bin/bash as well.

bash 5.2.15 installed via macports but /bin/bash that comes with macOS is also ignored

Thanks for the compatibility list. I didn't know that they have one. Fira Code was working as was Victor Mono even though Rio isn't on the list.

ralgozino commented 1 year ago

I'm on macos and I use Victor Mono. It "works" but has some issues, I've also tested Fira Code, with the same result. It is a known issue and I believe Rapha is working on it.

Rio will ignore the configuration file if there's anything that it doesn't like (#168). I'd recommend trying to add one line at a time to the configuration file until you find which line is not working.

This is my fonts configuration:

[fonts]
[fonts.regular]
family = "Victor Mono"
style = "normal"
weight = 400
[fonts.bold]
family = "Victor Mono"
style = "bold"
weight = 800
[fonts.italic]
family = "Victor Mono"
style = "italic"
weight = 400
[fonts.bold-italic]
family = "Victor Mono"
style = "bold italic"
weight = 800

(using Fira Code instead of "Victor Mono" should also work)

raphamorim commented 1 year ago

Yes, is exactly as @ralgozino mentioned.

I am working in a hint UI (connected to #168) so whenever rio fails to load a font it tells you why. One of the biggest reasons that could be failing 0.0.18 is that weight wasn't found (settled as 400 and found as 800) but the error is silent and is hard to figure out why today, so I think the #168 should be prioritized

ehjmx commented 1 year ago

@ralgozino I used your configuration for Victor Mono and Rio still refuses to load the configuration file. I downloaded Victor Mono from https://rubjo.github.io/victor-mono/ and used otf as well as ttf

If I don't use any setting for font Rio works as expected and reads the config.toml.

For now I have a workaround but it would be nice if I can switch back to Fira Code. I'm not that deep into fonts so how would I get the necessary information to put behind style or weight for Fira Code? Are they available in their documentation?

ralgozino commented 1 year ago

@ralgozino I used your configuration for Victor Mono and Rio still refuses to load the configuration file. I downloaded Victor Mono from https://rubjo.github.io/victor-mono/ and used otf as well as ttf

If I don't use any setting for font Rio works as expected and reads the config.toml.

I guess that there's something missing with the font that makes the configuration option fail.

I installed Victor Mono using the brew cask (the same for Fira Code). Have you tried that?

For now I have a workaround but it would be nice if I can switch back to Fira Code. I'm not that deep into fonts so how would I get the necessary information to put behind style or weight for Fira Code? Are they available in their documentation?

This should work with Fira Code:

[fonts.regular]
family = "Fira Code"
style = "regular"
weight = 200
[fonts.bold]
family = "Fira Code"
style = "bold"
weight = 400

You can see the styles provided by the font in the macos "Font Bok" app, for example, I can see that in my case there's no style for italics available. I don't know about the weights, maybe in the Font's documentation? I'm not sure.

raphamorim commented 1 year ago

If enable the logs with RIO_LOG_LEVEL or set in the configuration

[developer]
log-level = "INFO"

it should show the reason (font not found or the weight wasn't found

ehjmx commented 1 year ago

Where would I find the log?

With

[fonts]
size = 16
[fonts.regular]
family = "Fira Code"
style = "Retina"
weight = 450
[fonts.bold]
family = "Fira Code"
style = "Bold"
weight = 600

Fira Code is detected and according to Font Forge and those VS-Code Instructions they are the correct weights.

If I comment those entries out I get the wrong font but everything else works as expected.

Opening bash with /opt/local/bin/bash --login opens bash with the correct Fira Code etc.

ralgozino commented 1 year ago

Where would I find the log?

You'll need to open rio from a terminal (it can be rio itself), i.e. run the rio command, a new instance of rio should open and you should see the logs in the terminal where you ran the command.

ehjmx commented 1 year ago

@ralgozino Indeed a new Rio instance opened when I ran rio from within /Applications/Rio.app/Contents/MacOS but sadly I get no output in the terminal be it rio, wezterm or Terminal.app that comes with macOS.

In the meantime I tried with CommitMono whose weights etc are documented and followed the instructions given to add this font to Visual Studio Code but still Rio doesn't load bash. As soon as I comment out the font section bash is loaded.

At the moment I leave the font section and start the bash with /opt/local/bin/bash --login

raphamorim commented 1 year ago

Just a FYI: @ehjmx This problem in main should be not reproduceable anymore. For three reasons:

raphamorim commented 1 year ago

Added error alert for fonts as well Screenshot 2023-09-09 at 14 09 39

raphamorim commented 1 year ago

Latest main:

error Ui

Closing this issue for now since will not be able to reproduce for next release, please let me know anything

ehjmx commented 10 months ago

@raphamorim I initially had hopes that perhaps with 0.0.20 or so the issues would be resolved but even in version 0.0.25 the behaviour didn't change on my Mac. When launching rio I don't get any warning.

As soon as I edit something in the [window] or [fonts] section the shell.program setting gets ignored.

MacBook Pro M2 13inch macOS 13.6.1 Rio 0.0.25 Fonts tested: Fira Code and Commit Mono

Attached you find my current config.toml as a txt since Github won't accept the .toml file, a log file rio.log created when launching rio from within rio and rio_2.log when launching rio from the Terminal.app

config_rio.txt rio_2.log rio.log

raphamorim commented 10 months ago

Hey @ehjmx I think had a regression with this the error UI functionality (isn't the firs time I heard it). Would you mind create an issue?