wez / wezterm

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

Dubious interaction between search and copy mode when search is not empty #4608

Open vsiles opened 11 months ago

vsiles commented 11 months 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

20230712-072601-f4abf8fd

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

There is a strange interaction between search mode and copy mode. When I enter copy-mode after performing a search, and the search pattern is not empty, the cursor jumps to an instance of the search and is right away in "region selection" mode. I can move around and select a region, but I can't move the origin of the selection area itself.

To do so, I have to either:

This feels like a bug and a feature: jumping right away on the latest search might be powerful, but it doesn't feel like it should be the default

To Reproduce

At this point, the cursor should jump to the search-query, and enter "region selection" as if v has been pressed

Configuration

https://github.com/vsiles/config/blob/master/wezterm/wezterm.lua

Expected Behavior

By default, entering Copy-Mode should always allow movement for the cursor, and not enter region-selection right away. This could be an option/parameter of ActivateCopyMode

Logs

No response

Anything else?

No response

rafalglowacz commented 10 months ago

As a workaround, I've set this binding:

    {
        key = "X",
        mods = 'CTRL|SHIFT',
        action = wezterm.action_callback(function (window, pane)
            window:perform_action(act.ActivateCopyMode, pane)
            window:perform_action(act.CopyMode 'ClearPattern', pane)
        end),
    },

But as I said, it's a workaround - it makes the search status bar appear for a split second and it clears the search pattern, so if you later want to search again, it'll be gone.

kyu08 commented 3 months ago

@rafalglowacz Thanks! This works for me!