zellij-org / zellij

A terminal workspace with batteries included
https://zellij.dev
MIT License
19.42k stars 611 forks source link

Unable to extend selection passed pane/window boundaries #3358

Open samholmes opened 1 month ago

samholmes commented 1 month ago

I'm using Alacritty. When I select output text that is lengthy and exceeds the boundaries of the visible output in the buffer, then the buffer scrolls in the direction of the selection in order to extend my selection.

In Zellij, I cannot select text unless I hold shift, and when the output length exceeds the number of lines which can be printed in the visible portion of the buffer, then I am unable to extend my selection further then the boundaries of the text within view (the window or pane). This seems like a regression in capabilities and a bug.

I suggest a fix that allows you to scroll the pane/window just like Alacritty would.

imsnif commented 1 month ago

I think the issue is that you're using shift in order to select text. This means you're deferring to the selection of the terminal emulator (Alacritty in this case) rather than Zellij. The terminal emulator doesn't know about the scrollback - which is managed by Zellij - and thus can't mark it.

I'd recommend not using shift to mark text, and if you have an issue with that - you are more than welcome to log on to one of our support platforms (eg. Discord) and ask for help troubleshooting. A hint to get you started: this is often caused by the terminal background color colliding with your Zellij theme, making it seem as if you're not marking when you actually are.

samholmes commented 1 month ago

I'd recommend not using shift to mark text

How do I do that?

giyany commented 1 month ago

Why do you use shift? I'm on Alacritty and select without shift - just with normal left mouse click. As imsnif points out, it's perhaps possible in your case too but the background color may make it seem like you're not selectting when you actually are.

samholmes commented 1 month ago

Why do you use shift? I'm on Alacritty and select without shift - just with normal left mouse click. As imsnif points out, it's perhaps possible in your case too but the background color may make it seem like you're not selectting when you actually are.

Selecting without holding "shift" does nothing for some reason. I thought shift was required in order to allow for mouse/cursor events to pass through to the app. I'm not sure where this is configured and I don't know how to change it.

I'm running on macOS Sonoma 14.2.1, Alacritty 0.10.1 (1), Zellij v0.39.2.

samholmes commented 1 month ago

Further investigation, it looks like when Alacritty is running a program which captures mouse events, then holding the shift key is required for Alacritty to handle the mouse events instead of the program (which results in text selection): https://arc.net/l/quote/lqpjbsgg

So, it seems what I'm looking for is a way for Zellij to handle the mouse events such that it will start/end text selection within panes. Why doesn't Zellij handle text selection for me when I click and drag using the mouse?