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

Doesn't work when have 2 or more panes opened #69

Open
vyorkin opened this issue Dec 25, 2020 · 24 comments
Open

Doesn't work when have 2 or more panes opened #69

vyorkin opened this issue Dec 25, 2020 · 24 comments
Labels
bug Something isn't working

Comments

@vyorkin
Copy link

vyorkin commented Dec 25, 2020

No description provided.

@0xC0FFEE
Copy link

Great Plugin!

I've been using the Kitty Hints Kitten up to now, however I've recently started looking into tmux-thumbs to streamline by workflow a bit.

One feature I'm missing dearly is to extract patterns from other visible panes.

Consider the following use case: I've two panes open. One with a git log and one with a shell. Now I want to display the diff of a specific commit, for this I type git show in the shell and would like to pick the commit hash form the other pane by invoking tmux-thumbs.

Maybe it would make sense to offer another command, which works on all visible panes?

@fcsonline
Copy link
Owner

@vyorkin Can you provide a bit more information to reproduce the bug? Having two or more panes is a really common use case.

@0xC0FFEE Can you open a different issue to track this feature request, please?

@TutenStain
Copy link
Contributor

I have also stumbled across this issue once or twice. Not really sure during which pane configurations but the next time this happens I will try to take a look or at least note down my tmux configuration and post it here.

@mahmoudhossam
Copy link

I think this is because prefix + space invokes :next-layout by default in tmux.

Source

@simaoneves
Copy link

simaoneves commented Jan 20, 2021

Just installed and messing a bit with configuration. There is something fishy here for sure.
In my tests i was able to replicate it, panes that are horizontal always fail (Rust panic? not sure).
If you switch the layout using prefix + space until you have vertical panes it works (even when previously it didn't for the same pane).

Also, if you are in copy-mode, it always works, regardless of pane "orientation"

tmux -V = 3.1c
tmux-thumbs = built from master, 0.5.0 i believe

EDIT:

Well, not sure if it's orientation now, sometimes it works, other it does not 🤷 but changing the layouts triggers things

@fcsonline
Copy link
Owner

If you are able to reproduce it, it will be awesome. I tried with many layouts, horizontal, vertical, copy mode, zoom, etc, and all of them work for me. I'm in tmux 3.0 and last tmux-thumbs master. Ensure you have the latest tmux-thumbs code compiled in release mode. I fixed some bugs about zooming and panes a few weeks ago.

@listx
Copy link
Contributor

listx commented Jun 15, 2021

For me I can reproduce if:

  1. there are 2 panes open (C-b ")
  2. 1 pane is running vim
  3. the cursor is inside the vim pane
  4. I invoke C-b Space (default binding to trigger tmux-thumbs).

It's weird because if I replace Step 1 with the vertical layout (C-b %), Step 4 is flaky (it works sometimes, sometimes not). I also did notice at one point that not all of the strings were getting matched (some IP addresses near the cursor in vim). FWIW if I split with C-b ", Step 4 reliably fails every time AFAICS.

I'm on Mac with Alacritty 0.8.0, tmux 3.2. I installed tmux-thumbs today using tpm.

@aca
Copy link

aca commented Feb 2, 2022

When there's more thant 2 pane in window. It rarely works. (It works sometimes, but hard to figure out why)
It breaks the pane and create new window [thumbs].

@fcsonline fcsonline added the bug Something isn't working label Feb 2, 2022
@fcsonline
Copy link
Owner

I will try to battle test these use cases.

@fcsonline
Copy link
Owner

I battle tested in my Linux + tmux 3.0a with multiple panes (vertical and horizontal), moving them, multiple windows and many more and always work. 😕

@dayyeung
Copy link

dayyeung commented Feb 8, 2022

for me it always acts weird (buffer jumps backward) when the pane

  • is a horizontal pane (top/bottom)
  • in copy mode

at the same time

tmux 3.2a
tmux-thumbs 0.7.1

I'm able to reproduce it consistently on both Mac and WSL
let me know what else I can provide

@fcsonline
Copy link
Owner

I don't know if that's asking too much, but could you record a video? It's just to understand the behavior.

@dayyeung
Copy link

dayyeung commented Feb 8, 2022

sure thing!

tmux-thumbs-issue-69.mp4

note: my prefix binding is C-s

  • no issues when in single pane
  • no issues when in horizontal pane without copy mode
  • when in copy mode, history jumps up
  • when in copy mode and at history top, no hints are shown

@fcsonline
Copy link
Owner

So, the problems are related to copy-mode. I'll investigate and test it.

@fcsonline
Copy link
Owner

I have been testing in copy-mode and everything works for me. 🤔

Is someone else facing this issue?

@aca
Copy link

aca commented Feb 12, 2022

@fcsonline

https://asciinema.org/a/2TLriuUFvJaue6VkPbVZkwGDi

[thumbs] pane open and exit directly. Not working also on normal mode.

# minimal config
set -g @thumbs-regexp-1 '\w{1,50}' # Match emails
set -g @thumbs-key w
run ~/.tmux/plugins/tmux-thumbs/tmux-thumbs.tmux
$ tmux -V
tmux next-3.4

$ uname -a
Linux rok-te3 5.16.4-arch1-1 #1 SMP PREEMPT Sat, 29 Jan 2022 19:08:13 +0000 x86_64 GNU/Linux
# also doesn't work on mac

And there's also an issue that it doesn't work if i am using non posix shell (elvish). (Used /bin/sh for the screencast)

@fcsonline
Copy link
Owner

fcsonline commented Feb 12, 2022

I have tested this configuration in my bash terminal, and it works. :/ Also, with /bin/sh works.

Could you try a thing?

Try to run this: ls -la | ~/.tmux/plugins/tmux-thumbs/target/release/thumbs

This will run thumbs in standalone mode, without the tmux integration. It is just to bisect the issue.

@aca
Copy link

aca commented Feb 14, 2022

image

Output is messy (doesn't wrap) but works.

@perpen
Copy link

perpen commented Mar 27, 2022

I was running into the issue every time I opened a pane vertically (below current).

I wrote a small wrapper script for tmux, logging all calls to files, and I realised that depending on trivial changes in this wrapper, I would encounter the bug or not. Skipping on the details, but it looks like the bug occurring or not depends on the order of execution of tmux capture-pane and tmux swap-pane -d -s ... -t ....

Then I added a pause in the main function of swapper.rs, which fixes the issue.

  swapper.execute_thumbs();
  std::thread::sleep(std::time::Duration::from_millis(10));
  swapper.swap_panes();

I still don't understand why, as execute_thumbs() is not async afaics. But then I don't know much rust :)

@fcsonline
Copy link
Owner

I can't understand how is this possible, because as you said, everything is sync and the process waits all the commands to finish.

@perpen
Copy link

perpen commented Jun 14, 2022

I just installed thumbs on my work mac, and I have been getting the same problem as I was on linux.
And the sleep() call fixed it here as well.
For this to happen on such a completely different env, there may be something about my tmux.conf. IIRC I had gone back to an almost empty tmux.conf in March and still had the problem, but maybe I didn't do it right. Maybe I'll test it sometime.

@ghost
Copy link

ghost commented Sep 18, 2022

By any chance, is this issue related to the fact that activating tmux-thumbs in a window with split panes (horizontal or vertical) only shows hints in the current pane? This is a screencast that explains better the issue:

screencast-220918-1744-29_1.mp4

@dagadbm
Copy link

dagadbm commented Jan 5, 2023

I also have the same issue this is probably related to some conflicting key binding that another plugin is making for sure right?

I always asumed this was the default behavior. working only on one pane.

@dagadbm
Copy link

dagadbm commented Jan 5, 2023

might be a long shot but I also use asdf and a rust compiled version of tmux-thumbs so the binary is being managed by asdf.

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