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

Command for setting user vars is being printed before each command #5007

Open
alioguzhan opened this issue Feb 13, 2024 · 8 comments
Open

Command for setting user vars is being printed before each command #5007

alioguzhan opened this issue Feb 13, 2024 · 8 comments
Labels
bug Something isn't working

Comments

@alioguzhan
Copy link

What Operating System(s) are you seeing this problem on?

Linux X11

Which Wayland compositor or X11 Window manager(s) are you using?

Kde Plasma 5.27.10
XDG_SESSION_TYPE=x11

WezTerm version

20240203-110809-5046fc22

Did you try the latest nightly build to see if the issue is better (or worse!) than your current version?

No, and I'll explain why below

Describe the bug

If I spawn a new terminal from inside a tmux session: all my commands get a prefix (a command is printed, specifically):

image

I can see this is coming from: https://github.com/wez/wezterm/blob/main/assets/shell-integration/wezterm.sh#L435

The weird part for me was, that even if I open another terminal (Tilix) I see these WezTerm logs.

But not sure if this is an issue on the WezTerm side or Tmux or Neovim. Any guidance or help would be great.

To Reproduce

  1. Open WezTerm
  2. create a Tmux session
  3. open nvim (nvim --clean)
  4. create a terminal buffer (:terminal)
  5. run any command

Configuration

local wezterm = require 'wezterm'

return {
  font = wezterm.font("JetBrainsMono Nerd Font"),
  font_size = 12.0,
  color_scheme = "Tokyo Night",
  audible_bell = "Disabled",
}

Expected Behavior

No response

Logs

No response

Anything else?

No response

@alioguzhan alioguzhan added the bug Something isn't working label Feb 13, 2024
@GusJelly
Copy link

I also have this issue, I am running on Hyprland so I don't think it has anything to do with the display server. It probably has to do with some interaction between wezterm and neovim.

@alioguzhan
Copy link
Author

Either it is because wezterm / tmux or we both have the same plugin that causes this... @GusJelly

I still couldn't find the cause of this.

@GusJelly
Copy link

@alioguzhan I think it's a weird interaction between the user vars that wezterm sets, tmux and neovim. It's not caused by a plugin since it still happens with nvim --clean.

I'm working right now so later today I will take some time and try to figure this out.

@GusJelly
Copy link

GusJelly commented Jun 1, 2024

After looking into what was happening, it seems to me that this is due to a bug between neovim and tmux. For some reason they are not ignoring the \033]1337 when using the neovim terminal, I'm sorry but I'm not familiar with the code that tmux and neovim use for their terminals.

@rockyzhang24
Copy link

This issue still persists. I am using the nightly wezterm and nightly Neovim.

@majordoobie
Copy link

I am using the stable version with the same issue. For me, it only shows up when I spawn a floating window from neovim.

@alioguzhan
Copy link
Author

alioguzhan commented Sep 10, 2024

I found a temporary solution for this. The issue is gone when I disabled the zsh integration. Now, I am on NixOS and using home-manager. I just set enableZshIntegration = false. But for those who are not using home-manager, I am not sure how to disable this.

Here is the related home-manager source file for this option:

https://github.com/nix-community/home-manager/blob/release-24.05/modules/programs/wezterm.nix#L11C5-L11C53

Simply it is this line:

 source "${cfg.package}/etc/profile.d/wezterm.sh"

Removing this from the zsh config did the trick.

You can check your zshrc to see if something like this is there. Try to disable that line.

I hope this will be helpful for both users and maintainers.

@FedericoStra
Copy link

I have the same issue. I have temporarily patched it by putting

# FIXME: this script causes issues in the `:terminal` in `neovim` inside `tmux`...
# For the time being, disable the script when inside `neovim`.
if [ -n "$NVIM" ]; then
  WEZTERM_SHELL_SKIP_ALL=1
fi

in /etc/profile.d/wezterm.sh before the check to skip all the script.

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

5 participants