aureolebigben / wezterm-cmd-sender

A simple plugin to send command to multiple pane in wezterm
MIT License
0 stars 0 forks source link

runtime error: ...comsZsaureolebigbensZswezterm-cmd-sender/plugin/init.lua:53: #1

Closed NeckBeardPrince closed 2 weeks ago

NeckBeardPrince commented 3 weeks ago
runtime error: ...comsZsaureolebigbensZswezterm-cmd-sender/plugin/init.lua:53:
bad argument #1 to 'insert' (table expected, got nil)
stack traceback:
        [C]: in function 'table.insert'
        ...comsZsaureolebigbensZswezterm-cmd-sender/plugin/init.lua:53: in
function 'httpssCssZssZsgithubsDscomsZsaureolebigbensZswezterm-cmd-
sender.apply_to_config'
        [string "/Users/adam.stracener/.config/wezterm/wezterm..."]:12: in main chunk

Here is my wezterm.lua

-- Pull in the wezterm API
local wezterm = require("wezterm")
local config = wezterm.config_builder()
local opacity = 0.75
local transparent_bg = "rgba(22, 24, 26, " .. opacity .. ")"

-- Plugins

-- A simple plugin to send command to multiple pane in wezterm
-- https://github.com/aureolebigben/wezterm-cmd-sender
local cmd_sender = wezterm.plugin.require("https://github.com/aureolebigben/wezterm-cmd-sender")
cmd_sender.apply_to_config(config, {
  key = "S",
  mods = "CTRL|SHIFT",
  description = "Enter command to send to all panes of active tab",
})

-- A wezterm tab bar with batteries included
-- https://github.com/adriankarlen/bar.wezterm
local bar = wezterm.plugin.require("https://github.com/adriankarlen/bar.wezterm")

bar.apply_to_config(config)

-- Set leader key
config.leader = { key = "b", mods = "OPT", timeout_milliseconds = 1500 }

-- Colors
config.colors = require("themes/neofusion")
config.force_reverse_video_cursor = true

-- Font
config.font_size = 14
config.font = wezterm.font_with_fallback({
  {
    family = "JetBrainsMono Nerd Font",
    weight = "Bold",
  },
  "Segoe UI Emoji",
})

-- Misc
config.scrollback_lines = 10240
config.warn_about_missing_glyphs = false

-- Keybinds
config.disable_default_key_bindings = false
config.keys = require("keybinds")

-- Window
config.initial_rows = 45
config.initial_cols = 180
config.window_decorations = "RESIZE"
config.window_background_opacity = 0.75
config.macos_window_background_blur = 30
config.window_close_confirmation = "NeverPrompt"
config.max_fps = 144
config.animation_fps = 60
config.cursor_blink_rate = 250
config.native_macos_fullscreen_mode = true

-- Tabs
config.enable_tab_bar = true
config.hide_tab_bar_if_only_one_tab = true
config.show_tab_index_in_tab_bar = false
config.use_fancy_tab_bar = false
config.colors.tab_bar = {
  background = transparent_bg,
  new_tab = { fg_color = config.colors.background, bg_color = config.colors.brights[6] },
  new_tab_hover = { fg_color = config.colors.background, bg_color = config.colors.foreground },
}

-- Format tab title
wezterm.on("format-tab-title", function(tab, _, _, _, hover)
  local background = config.colors.brights[1]
  local foreground = config.colors.foreground

  if tab.is_active then
    background = config.colors.brights[7]
    foreground = config.colors.background
  elseif hover then
    background = config.colors.brights[8]
    foreground = config.colors.background
  end

  local title = tostring(tab.tab_index + 1)
  return {
    { Foreground = { Color = background } },
    { Text = "█" },
    { Background = { Color = background } },
    { Foreground = { Color = foreground } },
    { Text = title },
    { Foreground = { Color = background } },
    { Text = "█" },
  }
end)

-- Show active workspace in right status
wezterm.on("update-right-status", function(window, pane)
  window:set_right_status(wezterm.format({
    { Foreground = { Color = "#9b9ea4" } },
    { Text = window:active_workspace() },
  }))
end)

-- Panes
config.inactive_pane_hsb = { saturation = 0.5, brightness = 0.9 }

-- Mouse settings
config.pane_focus_follows_mouse = true
config.mouse_bindings = {
  -- Ctrl-click will open the link under the mouse cursor
  {
    event = { Up = { streak = 1, button = "Left" } },
    mods = "CTRL",
    action = wezterm.action.OpenLinkAtMouseCursor,
  },
}

-- Set cursor styles
config.default_cursor_style = "BlinkingBar"

-- Set visual bell and audio bell
config.audible_bell = "Disabled"
config.visual_bell = {
  fade_in_duration_ms = 75,
  fade_out_duration_ms = 75,
  target = "CursorColor",
}

-- and finally, return the configuration to wezterm
return config
aureolebigben commented 2 weeks ago

Hello, i will look into this problem

aureolebigben commented 2 weeks ago

The bug is fixed.

You can update the plugin by running a ‘git pull’ inside the plugin folder.

Enter wezterm.plugin.list() in the Wezterm Debug Overlay (Ctrl + Shift + L) to see where they are stored.