rajasegar / alacritty-themes

:rainbow: :lollipop: Themes :candy: :heart_eyes: for Alacritty: A cross-platform GPU-accelerated Terminal emulator
MIT License
685 stars 70 forks source link

alacritty-themes stopped working since TOML config #261

Open Neo-29 opened 6 months ago

Neo-29 commented 6 months ago

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:

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

emilBeBri commented 6 months ago

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

wcheek commented 2 months ago

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 commented 2 months ago

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 commented 2 months ago

@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 commented 2 months ago

@wcheek ok that makes sense.

rajasegar commented 2 months ago

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

wcheek commented 2 months ago

@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 commented 2 months ago

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 commented 2 months ago

Pushed a new release 6.0.2 in npm

Neo-29 commented 2 months ago

I tested the new version

No preview of the themes when scrollling...

is it normal?

rajasegar commented 2 months ago

@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