Skip to content
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

alacritty-themes stopped working since TOML config #261

Open
1 of 5 tasks
Neo-29 opened this issue Jan 2, 2024 · 11 comments
Open
1 of 5 tasks

alacritty-themes stopped working since TOML config #261

Neo-29 opened this issue Jan 2, 2024 · 11 comments
Labels
bug Something isn't working

Comments

@Neo-29
Copy link

Neo-29 commented Jan 2, 2024

Describe the bug

A clear and concise description of what the bug is.

To Reproduce

use alacritty-themes

  1. See error
const NoAlacrittyFileFoundError = new Error(
                                  ^

Error: No Alacritty configuration file found.
Expected one of the following files to exist:
/home/neo29/.config/alacritty/alacritty.yml
/home/neo29/.alacritty.yml
Or you can create a new one using `alacritty-themes --create`
    at Object.<anonymous> (/usr/lib/node_modules/alacritty-themes/src/helpers/index.js:6:35)
    at Module._compile (node:internal/modules/cjs/loader:1375:14)
    at Module._extensions..js (node:internal/modules/cjs/loader:1434:10)
    at Module.load (node:internal/modules/cjs/loader:1206:32)
    at Module._load (node:internal/modules/cjs/loader:1022:12)
    at Module.require (node:internal/modules/cjs/loader:1234:19)
    at require (node:internal/modules/helpers:176:18)
    at Object.<anonymous> (/usr/lib/node_modules/alacritty-themes/bin/cli.js:12:5)
    at Module._compile (node:internal/modules/cjs/loader:1375:14)
    at Module._extensions..js (node:internal/modules/cjs/loader:1434:10)

Expected behavior

usual behaviour with choices

A clear and concise description of what you expected to happen.

Operating System:

  • Windows
  • Ubuntu
  • Pop Os
  • Arch gnome on wayland
  • Other, which one?

Add your alacritty.yml content

decorations = "None"
opacity = 0.85

[font]
size = 10

[cursor]
style = { blinking = "Always" }

[colors.primary]
background = "#20201d"
foreground = "#a6a28c"

[colors.cursor]
text   = "#20201d"
cursor = "#a6a28c"

[colors.normal]
black   = "#20201d"
red     = "#d73737"
green   = "#60ac39"
yellow  = "#cfb017"
blue    = "#6684e1"
magenta = "#b854d4"
cyan    = "#1fad83"
white   = "#a6a28c"

[colors.bright]
black   =  "#7d7a68"
red     =  "#d73737"
green   =  "#60ac39"
yellow  =  "#cfb017"
blue    =  "#6684e1"
magenta =  "#b854d4"
cyan    =  "#1fad83"
white   =  "#fefbec"

warning new toml config

@Neo-29 Neo-29 added the bug Something isn't working label Jan 2, 2024
@Neo-29 Neo-29 changed the title alacriity-thems stopped working since TOML config alacritty-themes stopped working since TOML config Jan 2, 2024
@emilBeBri
Copy link

I get this too, of course - everyone with the newest version will.

@wcheek
Copy link

wcheek commented Apr 9, 2024

Still waiting for this.. Note that the official installation instructions and configuration documentation tell people to use the new TOML configuration file... so you're losing a lot of potential users with this lack of support.

@emilBeBri
Copy link

emilBeBri commented Apr 9, 2024

Still waiting for this.. Note that the official installation instructions and configuration documentation tell people to use the new TOML configuration file... so you're losing a lot of potential users with this lack of support.

What do you mean " waiting for this"? You can install it manually in 5 minutes. You don't need to wait.

@wcheek
Copy link

wcheek commented Apr 9, 2024

@emilBeBri Of course it's what I ended up doing after alacritty-themes didn't work. Just trying to be helpful to let developers know this issue breaks this project for anybody following the latest setup documentation - and that it's been over three months since the issue was noticed.

@emilBeBri
Copy link

@wcheek ok that makes sense.

@rajasegar
Copy link
Owner

I made a new release v6.0.0 in npm, please check and let me know or any issues

@wcheek
Copy link

wcheek commented Apr 9, 2024

@rajasegar So fast.

It looks like it works now. There are a few issues I see.

First problem

Before replacing my entire custom config file the TOML parser threw an error about one of my keybindings:

C:\Users\104104\AppData\Roaming\npm\node_modules\alacritty-themes\node_modules\@iarna\toml\lib\toml-parser.js:17
  const terr = new TomlError(err.message)
               ^

TomlError: Control characters (codes < 0x1f and 0x7f) are not allowed in strings, use \u007f instead at row 320, col 16, pos 4793:
319: [[keyboard.bindings]]
      at TOMLParser.parseBasicString (C:\Users\104104\AppData\Roaming\npm\node_modules\alacritty-themes\node_modules\@iarna\toml\lib\toml-parser.js:670:22)
      at TOMLParser.runOne (C:\Users\104104\AppData\Roaming\npm\node_modules\alacritty-themes\node_modules\@iarna\toml\lib\parser.js:64:30)
      at TOMLParser.goto (C:\Users\104104\AppData\Roaming\npm\node_modules\alacritty-themes\node_modules\@iarna\toml\lib\parser.js:87:17)
      at TOMLParser.recordEscapeReplacement (C:\Users\104104\AppData\Roaming\npm\node_modules\alacritty-themes\node_modules\@iarna\toml\lib\toml-parser.js:678:19)
      at TOMLParser.runOne (C:\Users\104104\AppData\Roaming\npm\node_modules\alacritty-themes\node_modules\@iarna\toml\lib\parser.js:64:30)
      at TOMLParser.returnNow (C:\Users\104104\AppData\Roaming\npm\node_modules\alacritty-themes\node_modules\@iarna\toml\lib\parser.js:107:17)
      at TOMLParser.parseUnicodeReturn (C:\Users\104104\AppData\Roaming\npm\node_modules\alacritty-themes\node_modules\@iarna\toml\lib\toml-parser.js:783:21)
      at TOMLParser.runOne (C:\Users\104104\AppData\Roaming\npm\node_modules\alacritty-themes\node_modules\@iarna\toml\lib\parser.js:64:30)
      at TOMLParser.parse (C:\Users\104104\AppData\Roaming\npm\node_modules\alacritty-themes\node_modules\@iarna\toml\lib\parser.js:45:22) {
    fromTOML: true,
    wrapped: null,
    line: 319,
    col: 15,
    pos: 4793
  },
  code: undefined,
  line: 319,
  col: 15,
  pos: 4793
}

Here is the suspect key binding:

[[keyboard.bindings]]
chars = "\u001b^?�"
key = "Back"
mods = "Alt"

Second problem

I did the fix the error suggested and the TOML parser successfully ran but has completely replaced my config with a simple import of the theme.. this is not really ideal since I lost some of my custom settings.. I'm able to add them back under the import.. but if I use alacritty-themes again, my custom settings are again removed.

Does alacritty-themes not preserve custom configs? If so, what is the point of the TOML parser if the config just get completely replaced?

@rajasegar
Copy link
Owner

It should, I think during the yml to toml conversion, there is some bug introduced, will fix it asap and let you folks know

@rajasegar
Copy link
Owner

Pushed a new release 6.0.2 in npm

  • Remove the preview option for now since it is buggy, you have to apply the theme to see the changes
  • If your old config is not preserved, you can restore them by renaming the latest backup file
    mv alacritty.toml.xxxxxx.bak alacritty.toml
  • Also ensure you remove these sections in your old config file to the new theme to take effect:
    • [colors.bright]
    • [colors.normal]
    • [colors.primary]

@Neo-29
Copy link
Author

Neo-29 commented Apr 9, 2024

I tested the new version

No preview of the themes when scrollling...

is it normal?

@rajasegar
Copy link
Owner

@Neo-29 Yes it is intended, since the preview functionality is buggy I turned it off temporarily
will update this thread once it is fixed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants