-
Notifications
You must be signed in to change notification settings - Fork 45
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
[Bug]: wezterm
CLI commands seem to run through shell, but it shouldn't
#261
Comments
I found discussions mentioning this issue, but they were all closed. However I found this behavior to be unchanged for about a year now |
Like we've done with the other issues, could you test the performance of |
Why adjust-pane-size? I'm not really using it here |
Just to narrow down if the issue is the plugin or the wezterm cli, you can try |
Ran this script: set N 100
set total_time 0
for i in (seq 1 $N)
set start_time (date +%s%N)
wezterm cli activate-pane-direction Right
set end_time (date +%s%N)
set elapsed (math "($end_time - $start_time)/1000000000")
set total_time (math "$total_time + $elapsed")
end
set average_time (math "$total_time / $N")
echo "Ran $N times."
echo "Average execution time: $average_time seconds." And this is the output: |
Sure, maybe wezterm cli executes not as fast as it could, but I think the problem is that on one single move it here is how much wezterm_exec executes:
|
Investigated this some more and looks like it's a problem with fish: Executed in 122.03 millis fish external In different shells there isn't a delay and time command add some strange time which isn't usr or sys time |
Hmm, I'm on Fish shell as well and have never been able to reproduce the performance issues. Additionally, according to
So the shell shouldn't even be involved. But, if you want to try it, you can try changing the We could also see if changing |
Yes, I tested with the new api, but performance was the same Now that I'm testing wezterm cli activate-pane-direction also improved after I improved startup time for fish |
Yeah, this is the part that I'm still stumped by. I'm passing the command to |
I wonder if using |
wezterm
CLI commands seem to run through shell, but it shouldn't
Thanks, I thought I was going crazy changing my config, thinking it was my problem. Tks for digging into this. Btw, i'm using wezterm, zsh and Neovim. No tmux. |
I've removed everything from my .zshrc (compinit, zsh plugins, powerlevel10k, asdf, fzf integration) and smart-splits moved instantly from Neovim to my wezterm pane. So yeah, it appears that zsh is being called somewhere. |
I really do not understand why. According to the Neovim help docs:
And my code is: local function wezterm_exec(cmd)
local command = vim.deepcopy(cmd)
table.insert(command, 1, config.wezterm_cli_path)
table.insert(command, 2, 'cli')
return vim.fn.system(command)
end It's a list of arguments... why is the shell involved??? |
This is probably a wezterm issue. wezterm cli might use shell in some way (weren't able to reproduce). Or observing an environment variable creates slowdown somehow |
Interesting @mister-choo. It does seem that wezterm does some stuff finding a GUI to connect to and maybe spawning a shell: |
Similar Issues
Neovim Version
NVIM v0.10.2
Build type: Release
LuaJIT 2.1.1731601260
Multiplexer Integration
Wezterm
Multiplexer Version
wezterm version: 20241119-101432-4050072d x86_64-unknown-linux-gnu
Window Environment: X11 GNOME Shell
Lua Version: Lua 5.4
Steps to Reproduce
Expected Behavior
Navigation from wezterm pane to nvim pane to take the same amount of time as from nvim pane to wezterm
Actual Behavior
Navigating from nvim pane to wezterm pane happens with about 2 sec delay
Minimal Configuration to Reproduce
wezterm config:
Additional Details and/or Screenshots
No response
The text was updated successfully, but these errors were encountered: