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

Zellij on shell startup is very slow #3618

Open
SerJaimeLannister opened this issue Sep 21, 2024 · 0 comments
Open

Zellij on shell startup is very slow #3618

SerJaimeLannister opened this issue Sep 21, 2024 · 0 comments

Comments

@SerJaimeLannister
Copy link

So I am using zsh when I start shell startup
I am using foot terminal & archlinux

This is my default shell script

PS1='%B%F{red}[%F{yellow}%n%F{green}@%F{blue}%M %F{magenta}%~%F{red}]%f%b$ '


precmd_functions+=(_lazy_load_plugins)
_lazy_load_plugins() {
    lazy_load zsh-autosuggestions
    lazy_load zsh-syntax-highlighting
    unset -f _lazy_load_plugins
}
alias fastfetch='command fastfetch'

# History configuration
HISTFILE=~/.cache/zsh/history
HISTSIZE=10000
SAVEHIST=10000

# Completion system
zstyle ':completion:*' menu select
zmodload zsh/complist
autoload -Uz compinit
if [[ -n ~/.cache/zsh/zcompdump(#qN.mh+24) ]]; then
    compinit -d ~/.cache/zsh/zcompdump
else
    compinit -C -d ~/.cache/zsh/zcompdump
fi
_comp_options+=(globdots)

# Cursor shape
set_cursor_shape() { echo -ne '\e[5 q' }
precmd_functions+=(set_cursor_shape)

# Zoxide initialization (lazy-loaded)
zoxide_init() { eval "$(zoxide init zsh)" }
alias cd='zoxide_init && cd'

# Bun setup
export BUN_INSTALL="$HOME/.bun"
export PATH=$BUN_INSTALL/bin:$PATH

# Golang setup
export GOPATH=$HOME/go
export PATH=$PATH:$GOPATH/bin

# Qt style override
export QT_STYLE_OVERRIDE=kvantum

# Lazy-load plugins
lazy_load() {
    local plugin="$1"
    local plugin_path="/usr/share/zsh/plugins/$plugin/$plugin.zsh"
    [ -f "$plugin_path" ] && source "$plugin_path" 2>/dev/null
}

# Aliases
alias ls='eza --icons=always -1'
alias ll='eza -al --group-directories-first'`

which runs pretty fast

but when I add this to the top of the zshrc

if [[ -z "$ZELLIJ" ]]; then
    if [[ "$ZELLIJ_AUTO_ATTACH" == "true" ]]; then
        zellij attach -c
    else
        zellij
    fi

    if [[ "$ZELLIJ_AUTO_EXIT" == "true" ]]; then
        exit
    fi
fi

which is the recommended way to start zsh on startup , it adds a lot of time to the terminal

when I first start terminal from a system shutdown , it can take as much as 30-40 seconds
it progressively gets better but still stays as 4-5 second where the cursor just blinks and is waiting for zellij to start

Is there any way to fix this?
I am more than willing to customize zshrc to fix this issue

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant