MLFlexer / modal.wezterm

Vim-like modal keybindings for your terminal! ✌️
MIT License
26 stars 0 forks source link

Can't setup plugin - Cannot convert `Null` to `Config` #32

Closed Heryz1 closed 6 days ago

Heryz1 commented 1 week ago

Hello, I've never installed any plugins with wezterm and I tried to install modal.wezterm, but I couldn't achieve the installation.

My wezterm version is wezterm 20240203-110809-5046fc22, but I tried with an older version too.

My .wezterm.lua is :

local wezterm = require 'wezterm'
local config = {}

local modal = wezterm.plugin.require("https://github.com/MLFlexer/modal.wezterm")
modal.apply_to_config(config)

When I start wezterm, I have the following errors: In wezterm configuration error window:

Error converting lua value returned by script /home/toto/.wezterm.lua to
Config struct: error converting Lua nil to config::config::Config (Cannot
convert `Null` to `Config`)

In the other terminal:

18:48:42.618  ERROR  mux::connui > Configuration Error: Error converting lua value returned by script /home/toto/.wezterm.lua to Config struct: error converting Lua nil to config::config::Config (Cannot convert `Null` to `Config`)
18:48:42.994  ERROR  wezterm_gui::termwindow > Failed to apply config overrides to window: Error converting lua value returned by script /home/toto/.wezterm.lua to Config struct: error converting Lua nil to config::config::Config (Cannot convert `Null` to `Config`): nil
18:48:43.024  ERROR  wezterm_gui::termwindow > Failed to apply config overrides to window: Error converting lua value returned by script /home/toto/.wezterm.lua to Config struct: error converting Lua nil to config::config::Config (Cannot convert `Null` to `Config`): nil
18:48:43.048  ERROR  wezterm_gui::termwindow > Failed to apply config overrides to window: Error converting lua value returned by script /home/toto/.wezterm.lua to Config struct: error converting Lua nil to config::config::Config (Cannot convert `Null` to `Config`): nil
18:48:43.074  ERROR  wezterm_gui::termwindow > Failed to apply config overrides to window: Error converting lua value returned by script /home/toto/.wezterm.lua to Config struct: error converting Lua nil to config::config::Config (Cannot convert `Null` to `Config`): nil
18:48:43.101  ERROR  wezterm_gui::termwindow > Failed to apply config overrides to window: Error converting lua value returned by script /home/toto/.wezterm.lua to Config struct: error converting Lua nil to config::config::Config (Cannot convert `Null` to `Config`): nil
18:48:43.125  ERROR  wezterm_gui::termwindow > Failed to apply config overrides to window: Error converting lua value returned by script /home/toto/.wezterm.lua to Config struct: error converting Lua nil to config::config::Config (Cannot convert `Null` to `Config`): nil

Maybe I just don't know how to install a plugin with wezterm :P. Do you have any idea what is going on ?

MLFlexer commented 6 days ago

Hi! 😃 If I'm not mistaken, then this is a configuration issue, as Wezterm will interpret the value returned from the .wezterm.lua file as the config. In this case you are not returning your configuration, so the return value is nil or Null.

To fix it I would add the following line to the end of your configuration file, .wezterm.lua: return config Or you can replace your configuration with what is below:

local wezterm = require 'wezterm'
local config = {}

local modal = wezterm.plugin.require("https://github.com/MLFlexer/modal.wezterm")
modal.apply_to_config(config)

return config

I hope this helps! 😄 If not, then let me know

Heryz1 commented 6 days ago

Hi, looks like it's working now ! Thank you :)

MLFlexer commented 6 days ago

Awesome! 😄