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

ERROR IN PLUGIN when running action new-tab #65

Closed
cschmatzler opened this issue Jun 11, 2024 · 3 comments
Closed

ERROR IN PLUGIN when running action new-tab #65

cschmatzler opened this issue Jun 11, 2024 · 3 comments
Labels
bug Something isn't working

Comments

@cschmatzler
Copy link

cschmatzler commented Jun 11, 2024

Describe the bug
When running zellij action new-tab with -l and -c set, zjstatus fails to start.

To Reproduce
My settings:

config.kdl

default_shell "/opt/homebrew/bin/fish"
default_layout "zjstatus"
simplified_ui true
pane_frames false
theme "catppuccin-latte"
keybinds {
    normal {
        bind "Alt p" { 
            Run "/opt/homebrew/bin/fish" "-c" "$HOME/.scripts/open-project" {}
        }
    }
}

layouts/zjstatus.kdl

layout {
    pane split_direction="vertical" {
        children
    }
    pane size=1 borderless=true {
        plugin location="file:$HOME/.config/zellij/plugins/zjstatus.wasm" {
            format_left   "{mode} #[fg=#1e66f5,bold]{session}"
            format_center "{tabs}"
            format_right  "{datetime}"
            format_space  ""

            border_enabled  "false"
            border_char     "─"
            border_format   "#[fg=#6C7086]{char}"
            border_position "top"

            hide_frame_for_single_pane "true"

            mode_locked "#[fg=#dce0e8,bg=#e64553,bold] LOCKED "
            mode_normal "#[fg=#dce0e8,bg=#1e66f5,bold] NORMAL "
            mode_resize "#[fg=#dce0e8,bg=#179299,bold] RESIZE "
            mode_pane   "#[fg=#dce0e8,bg=#ea76cb,bold] PANE "
            mode_tab    "#[fg=#dce0e8,bg=#8839ef,bold] TAB "

            tab_normal   "#[fg=#1e66f5] {name} "
            tab_active   "#[fg=#8839ef,bold] {name} "

            datetime        "#[fg=#6C7086,bold] {format} "
            datetime_format "%A, %d %b %Y %H:%M"
            datetime_timezone "Europe/Berlin"
        }
    }
}

When running:
zellij action new-tab -l zjstatus -c ~/Development/personal/turboprop/

The new tab is opened with the correct working directory, but zjstatus fails to start.
image

Interestingly, I cannot find any entry about this in the zellij logs.

Expected behavior
zjstatus starts.

Screenshots
See above.

Desktop (please complete the following information):

  • OS: [e.g. iOS] macOS 14.5
  • Zellij version [e.g. v0.39.0] 0.40.1
  • Version [e.g. v0.9.0] 0.15.0

Layout

How does the layout look like? Please copy it into a code block.

See above.

Cheers

@cschmatzler cschmatzler added the bug Something isn't working label Jun 11, 2024
@dj95
Copy link
Owner

dj95 commented Jun 11, 2024

Hi and thanks a lot for the detailed bug report. I think this is an error in zellij and not zjstatus.

When I try your layout, the following log lines appear when running the command.

Screenshot 2024-06-11 at 22 47 06

This hints at some inconsistent behaviour when resolving the $HOME environment variable.

If I test your layout with an absolute path or ~ instead of $HOME, it seems to work.

Screen.Recording.2024-06-11.at.22.49.00.mov

Can you test this please?

@cschmatzler
Copy link
Author

Hey @dj95, thanks for the swift reply! Replacing $HOME with ~ in the layout worked. I'll recreate this bug in the zellij repo then, sorry for misplacing it :)

@dj95
Copy link
Owner

dj95 commented Jun 12, 2024

No worries, at first glance it looked like an issue in zjstatus. I'm glad that it works for you :) In addition, I addressed the issue and asked about it in the zellij discord.

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

2 participants