wez / wezterm

A GPU-accelerated cross-platform terminal emulator and multiplexer written by @wez and implemented in Rust
https://wezfurlong.org/wezterm/
Other
17.64k stars 788 forks source link

Error Running wezterm connect + imgcat not functional #3340

Closed stvhay closed 1 year ago

stvhay commented 1 year ago

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

macOS

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

No response

WezTerm version

wezterm 20230323-140304-acfb6b3c

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

Yes, and I updated the version box above to show the version of the nightly that I tried

Describe the bug

I am on macos and connecting to Debian 11.

A number of things happen when I connect via the ssh multiplexer and I don't know if they are normal or not, so I will describe them and then get to the point:

  1. I run: wezterm connect build-contabo where build-contabo is a very simple entry in the config per docs.
  2. Three windows open up. One of them does this and seems to be pretty normal:
image
  1. The others have this:
image

and

image
  1. I'm connected. But images dont load with imgcat. There appears to be allocated blank space, but no image.
image image
  1. Sometimes I get remnants of characters showing up in my terminal upon connection. There is also stuff showing up in my history on the host:
image

All of this happens all the time. The actual error I am getting is that I can't see the images and the following error is logged:

19:43:54.738  ERROR  wezterm_gui::termwindow > new_window has no tabs... yet?
19:43:58.428  INFO   wezterm_client::client  > going to run wezterm cli --prefer-mux proxy
19:44:02.546  ERROR  wezterm_gui::glyphcache > Unexpected EncodedFile; should have File here
19:44:44.381  ERROR  wezterm_gui::glyphcache > Unexpected EncodedFile; should have File here
19:45:41.804  ERROR  wezterm_client::pane::renderable > get_lines failed: unexpected response Ok(ErrorResponse(ErrorResponse { reason: "Error: no such pane 11" }))
19:45:41.804  ERROR  wezterm_client::pane::renderable > get_lines failed: unexpected response Ok(ErrorResponse(ErrorResponse { reason: "Error: no such pane 11" }))

Particularly the line

19:49:02.934  ERROR  wezterm_gui::glyphcache > Unexpected EncodedFile; should have File here

shows up everytime i run wezterm imgcat.

To Reproduce

See above. This happens every time I run wezterm connect.

Configuration

Client:

local wezterm = require 'wezterm'

local config = {}

if wezterm.config_builder then
    config = wezterm.config_builder()
end

config.keys = {
    -- Make Option-Left equivalent to Alt-b which many line editors interpret as backward-word
    { key="LeftArrow", mods="OPT", action=wezterm.action{SendString="\x1bb"} },
    -- Make Option-Right equivalent to Alt-f; forward-word
    { key="RightArrow", mods="OPT", action=wezterm.action{SendString="\x1bf"} },
}

config.font = wezterm.font 'Hack Nerd Font Mono'

config.color_scheme = 'Square'
config.color_scheme = 'lovelace'

config.ssh_domains = {
    {
        name = 'build-contabo',
        remote_address = 'xxx.xxx.xxx.xxx',
        username = 'stvhay',
    },
}

return config

Server:

local wezterm = require 'wezterm'
local config = {}

if wezterm.config_builder then
    config = wezterm.config_builder()
end

config.keys = {
    -- Make Option-Left equivalent to Alt-b which many line editors interpret as backward-word
    { key="LeftArrow", mods="OPT", action=wezterm.action{SendString="\x1bb"} },
    -- Make Option-Right equivalent to Alt-f; forward-word
    { key="RightArrow", mods="OPT", action=wezterm.action{SendString="\x1bf"} },
}

config.font = wezterm.font 'Hack Nerd Font Mono'
config.color_scheme = 'TerminixDark (Gogh)'

return config

Expected Behavior

Ideally, I expect no extra windows, no errors reported, and images displayed in the new window.

Logs

19:51:59.929  ERROR  wezterm_gui::termwindow > new_window has no tabs... yet?
19:52:01.864  INFO   wezterm_client::client  > going to run wezterm cli --prefer-mux proxy
19:52:03.275  ERROR  wezterm_gui::glyphcache > Unexpected EncodedFile; should have File here
19:52:03.663  ERROR  wezterm_gui::glyphcache > Unexpected EncodedFile; should have File here

Anything else?

I am running zsh and some plugins.

here is my .zshrc:

# If you come from bash you might have to change your $PATH.
export PATH=$HOME/.local/bin:$PATH

ZSH_THEME=""
PURE_PROMPT_SYMBOL=λ

export ZPLUG_HOME=$HOME/.zplug
source $ZPLUG_HOME/init.zsh

zplug "mafredri/zsh-async", from:github
zplug "sindresorhus/pure", use:pure.zsh, from:github, as:theme
zplug "zdharma/fast-syntax-highlighting", as:plugin, defer:2
zplug "zsh-users/zsh-autosuggestions", as:plugin, defer:2
zplug "plugins/git",   from:oh-my-zsh
zplug load

# Install plugins if there are plugins that have not been installed
if ! zplug check --verbose; then
    printf "Install? [y/N]: "
    if read -q; then
        echo; zplug install
    fi
fi

# aliases
alias tb='nc termbin.com 9999'

_idot() {
    rankdir="${1:-LR}"
    layout="${2:-dot}"
    fontcolor="${3:-white}"
    dot -K${layout} \
        -Efontsize=25 -Efontname="Hack Nerd Font Mono Regular" -Nfontname="Hack Nerd Font Mono Regular" \
        -Tpng \
        -Gbgcolor=black -Gcolor=white \
        -Ecolor=white -Efontcolor=${fontcolor} \
        -Ncolor=white -Nfontcolor=${fontcolor} \
        -Grankdir="${rankdir}" \
    | convert -trim -bordercolor black -border 20 -transparent black -resize '100%' - - \
    | wezterm imgcat
}

alias idot_td='_idot TD'
alias idot_lr='_idot LR'
alias idot='_idot LR'
alias icat='wezterm imgcat'
alias isvg='rsvg-convert | icat'

neofetch --iterm2 ~/debian.png
stvhay commented 1 year ago

Removed all zsh plugins on remote (server) and no effect.

stvhay commented 1 year ago

Ran from bash from client and no effect.

wez commented 1 year ago

The extra window stuff is a regression on the mac; it's a side effect of supporting command scripts (https://github.com/wez/wezterm/issues/2871)

Please open a separate issue for imgcat; I think I understand that one as well, but I want to fix this mac issue first.

wez commented 1 year ago

This should be resolved now in main.

Please take a few moments to try out the fix and let me know how that works out. You can find the nightly downloads for your system in the wezterm installation docs.

If you prefer to use packages provided by your distribution or package manager of choice and don't want to replace that with a nightly download, keep in mind that you can download portable packages (eg: a .dmg file on macOS, a .zip file on Windows and an .AppImage file on Linux) that can be run without permanently installing or replacing an existing package, and can then simply be deleted once you no longer need them.

If you are eager and can build from source then you may be able to try this out more quickly.

stvhay commented 1 year ago

fixed.

github-actions[bot] commented 1 year ago

I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues. If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.