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

CygwinBash+ssh(145msping)+tmux -> Super slow tmux pane resize #5370

Open
smprather opened this issue May 4, 2024 · 1 comment
Open

CygwinBash+ssh(145msping)+tmux -> Super slow tmux pane resize #5370

smprather opened this issue May 4, 2024 · 1 comment
Labels
bug Something isn't working Windows Issue applies to Microsoft Windows

Comments

@smprather
Copy link

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

Windows

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

No response

WezTerm version

20240429-102818-0184e88e

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

Mouse-drag-resize of tmux pane is crazy slow. I am comparing to both KiTTY and mintty which are both fine.

This is a deal-breaker for me. I'll have to use other terms until it can be fixed :(. And I really want to use WezTerm for configurability, (usually) speed, and great support/community!

To Reproduce

Ssh to a machine w/ tmux configured such that mouse is enabled. Create multiple panes. Drag an edge of the pane to resize it.

Configuration

-- Pull in the wezterm API
local wezterm = require 'wezterm'

-- This table will hold the configuration.
local config = {}

-- In newer versions of wezterm, use the config_builder which will
-- help provide clearer error messages
if wezterm.config_builder then
  config = wezterm.config_builder()
end

-- This is where you actually apply your config choices

-- For example, changing the color scheme:
config.color_scheme = 'Tango (base16)'

config.font = wezterm.font('Hack NFM')
config.font_size = 10
config.selection_word_boundary = ' \'",=[]$*{}<>()^#!`;\t:'
config.window_close_confirmation = 'NeverPrompt'

--wezterm.on('update-right-status', function(window, pane)
--  window:set_left_status 'left'
--  window:set_right_status 'right'
--end)

config.enable_tab_bar = false

config.window_padding = {
  left = 0,
  right = 0,
  top = 0,
  bottom = 0,
}

local mux = wezterm.mux

wezterm.on("gui-startup", function()
  local tab, pane, window = mux.spawn_window{}
  window:gui_window():maximize()
end)

config.default_prog = {'c:\\cygwin64\\bin\\bash',  '--login',  '-i', '-c', 'vdi'}
config.window_decorations = "RESIZE"

---cycle through builtin dark schemes in dark mode, 
---and through light schemes in light mode
local function themeCycler(window, _)
    local allSchemes = wezterm.color.get_builtin_schemes()
    local currentMode = wezterm.gui.get_appearance()
    local currentScheme = window:effective_config().color_scheme
    local darkSchemes = {}
    local lightSchemes = {}

    for name, scheme in pairs(allSchemes) do
        if scheme.background then
            local bg = wezterm.color.parse(scheme.background) -- parse into a color object
            ---@diagnostic disable-next-line: unused-local
            local h, s, l, a = bg:hsla() -- and extract HSLA information
            if l < 0.4 then
                table.insert(darkSchemes, name)
            else
                table.insert(lightSchemes, name)
            end
        end
    end
    local schemesToSearch = currentMode:find("Dark") and darkSchemes or lightSchemes

    for i = 1, #schemesToSearch, 1 do
        if schemesToSearch[i] == currentScheme then
            local overrides = window:get_config_overrides() or {}
            overrides.color_scheme = schemesToSearch[i+1]
            wezterm.log_info("Switched to: " .. schemesToSearch[i+1])
            window:set_config_overrides(overrides)
            return
        end
    end
end

config.keys = {
-- Theme Cycler
	{ key = "t", mods = "ALT", action = wezterm.action_callback(themeCycler) },
	-- Look up name of color scheme you switched to
    { key = "t", mods = "SHIFT|ALT", action = wezterm.action.ShowDebugOverlay },
}

-- and finally, return the configuration to wezterm
return config

Expected Behavior

Perform as fast as other terminal emulators. It's hard to put an 'X factor' on how much slower WezTerm is, but it's "a lot" - huge difference. I can't do a screen-record on this corp laptop. Hopefully you can reproduce it.

Logs

wezterm version: 20240429-102818-0184e88e x86_64-pc-windows-msvc
Window Environment: Windows
Lua Version: Lua 5.4
OpenGL: Intel(R) Iris(R) Xe Graphics 4.5.0 - Build 31.0.101.4887

Anything else?

I work on an ssh connection between Austin<->Sweden, so there may be something about the 145ms ping which exacerbates this problem.

Windows 10 22H2 19045.4291

Tmux configuration.

bind-key -n C-right   next-window
bind-key -n C-left    previous-window
bind-key -n S-right   select-pane -R
bind-key -n S-left    select-pane -L
bind-key -n S-down    select-pane -D
bind-key -n S-up      select-pane -U
bind-key    r         source-file ~/.tmux.conf
bind-key    1         select-layout even-horizontal
bind-key    2         select-layout even-vertical
bind-key    3         select-layout main-horizontal
bind-key    4         select-layout main-vertical
bind-key    5         select-layout tiled
bind-key    o         new-window \; split-window \; split-window -h \; select-pane -U \; split-window -h
bind-key -r Up        resize-pane -U
bind-key -r Down      resize-pane -D
bind-key -r Left      resize-pane -L
bind-key -r Right     resize-pane -R
bind-key -n C-s-Left  swap-window -t -1 -d
bind-key -n C-s-Right swap-window -t +1 -d

bind-key v 'capture-pane' \; \
  capture-pane -S - \; \
  save-buffer /tmp/tmux \; \
  delete-buffer \; \
  send-keys 'vi /tmp/tmux' Enter

# remap prefix
set -g prefix 'C-\'
unbind C-b
bind 'C-\' send-prefix

# If set to 0, I get 0;10;1c on every 'tmux attach'
# https://github.com/microsoft/WSL/issues/5931
set -s escape-time 1

# Recommended by neovim :checkhealth
set -g focus-events on

set -g default-terminal "screen-256color"
set -ga terminal-overrides ',*-256color*:Tc'
setw -g mode-keys vi
set -g pane-active-border-style "bg=red fg=red"
set -g status-right-length 0
set -g status-right ""
set -g window-status-format '#[fg=black]#{window_name}'
set -g window-status-current-style "fg=white bg=blue"
set -as terminal-overrides ",xterm*:RGB"
set -g renumber-windows on

# Tmux resurrect
# Save:    Prefix + ctrl-s
# Restore: Prefix + ctrl-r

# List of plugins
set -g @plugin 'tmux-plugins/tpm'
set -g @plugin 'tmux-plugins/tmux-resurrect'
set -g @plugin 'nhdaly/tmux-better-mouse-mode'

set-option -g mouse on
set -g @scroll-without-changing-pane "on"
set -g @scroll-in-moused-over-pane "on"
set -g @emulate-scroll-for-no-mouse-alternate-buffer "on"
# Make double-click selection use the right word boundaries
set -g word-separators " '\",=[]$*{}<>()^#!`;\t:"

# In gnome-terminal and derivatives (mate-terminal), when selecting text, you
# see a random looking string of text. This fixes it and doesn't seem to have any
# ill effects. https://tinyurl.com/2vd2e2n7 (super long link to askubuntu.com)
set -g set-clipboard on

# Initialize TMUX plugin manager (keep this line at the very bottom of tmux.conf)
run '~/.tmux/plugins/tpm/tpm'
@smprather smprather added the bug Something isn't working label May 4, 2024
@wez wez added the Windows Issue applies to Microsoft Windows label May 5, 2024
@krlvi
Copy link

krlvi commented May 11, 2024

Hey there, I am experiencing the same performance issue on MacOS with tmux 3.4

wezterm version: 20240203-110809-5046fc22 aarch64-apple-darwin
Window Environment: macOS 14.4.1 (23E224)
Lua Version: Lua 5.4
OpenGL: Apple M3 Pro 4.1 Metal - 88

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working Windows Issue applies to Microsoft Windows
Projects
None yet
Development

No branches or pull requests

3 participants