zellij-org / zellij

A terminal workspace with batteries included
https://zellij.dev
MIT License
21.78k stars 660 forks source link

Using neofetch into a panel layout #3287

Open matiux opened 7 months ago

matiux commented 7 months ago

I'm creating my first layout. I would have a panel with neofetch to see system information. This is my config

layout {
    pane cwd="/home/matiux" name="home"
    pane split_direction="vertical" {
        pane cwd="/" name="root" command="neofetch"
        pane name="htop" command="htop"
    }
}

I would like to have the prompt active after neofetch output, but instead I need to press ESC

Screenshot_20240420_231919

I would like to be in this status:

Screenshot_20240420_232410

MyApaulogies commented 7 months ago

I think the command you want to run is not neofetch but your shell with neofetch as a startup command. For Fish that would be fish -C neofetch

matiux commented 6 months ago

@MyApaulogies I have just tried like this

        pane split_direction="vertical" {
            pane cwd="/" name="root" command="/usr/bin/zsh" {
                args "-c" "neofetch"
            }
            pane name="htop" command="htop"
        }

But nothing seems to change. The behavior remains the same.

MyApaulogies commented 6 months ago

It looks like zsh -c doesn't go into interactive mode afterwards, see https://superuser.com/q/91881

matiux commented 6 months ago

@MyApaulogies There seems to be no clear solution. Or maybe I don't understand how

MyApaulogies commented 6 months ago

I think the easiest solution there was to just

pane command="/usr/bin/zsh" {
   args "-c" "neofetch; exec zsh"
}
matiux commented 6 months ago

I had tried with

if [[ $1 == eval ]]
then
    "$@"
set --
fi

but doesn't work very well as powerlevel10k warns me of unexpected output before running the prompt. Instead, args "-c" "neofetch; exec zsh" seems to works well.