vim-jukit icon indicating copy to clipboard operation
vim-jukit copied to clipboard

tmux3.3 upgrade -- inline plotting

Open nikisix opened this issue 2 years ago • 3 comments

I'm on (iterm2) tmux3.3 not 3.2a, so this is for folks that want to help get this amazing plugin up to speed with the new tmux version.

The Issue: inline image is displayed in the editor window instead of the output (or history) windows:

jukit-tmux-plots

The Culprit: tmux panes. The current and target panes are specified on the line: vim-jukit/autoload/jukit/splits.vim +227

                \. 'plt.show.__annotations__["tmux_panes"] = ["'
                \. current_pane . '", "' . target_pane . '"];'

And as you can see from the variable at runtime the current_pane is getting fumbled:

╭───────── In ─────────•••
│ plt.show.__annotations__
╰──────────────────────•••
Out[9]: {'tmux_panes': ['', '%60'], 'save_dpi': 150}

The Question: Even after specifying the correct current_pane at runtime like: plt.show.__annotations__['tmux_panes']=['%59','%60'] It still doesn't move the plot to the output split, but rather continues displaying in the editor.

An Idea: Once we answer the question above, perhaps we should name the output and history panes for more stable references like: select-pane -T <pane_name>

Just a thought, but curious to know what others think.

nikisix avatar Oct 26 '23 16:10 nikisix

After reading #14 I just realized I may have gotten around the needing to downgrade tmux thing by:

  1. pip install imgcat
  2. adding set-option -g allow-passthrough on to my .tmux.conf (as mentioned in the imgcat README).

Still getting the plot showing up in the current_pane as opposed to target_pane, as mentioned in #14, but I think that can be fixed by:

  1. getting current_pane to actually set
  2. figure out why the panes argument is coming up none in vim-jukit/helpers/imgcat/imgcat.py by figuring out what calls it.

nikisix avatar Oct 26 '23 17:10 nikisix

Looked into this a bit more and I'm pretty sure the check that's failing is:

helpers/imgcat/imgcat.py +232

    if panes is not None and is_tmux:
        os.system(f'tmux select-pane -t {panes[1]}')

I tried setting a breakpoint in here as a way to start editing the codebase, but my code changes didn't appear to have any behavioral effects. Is there something I need to do to trigger a rebuild? Basically, what's your dev-workflow look like?

nikisix avatar Oct 31 '23 23:10 nikisix

did you ever figure this out? I'm struggling with something similar

mathiaslovnes avatar Sep 15 '25 03:09 mathiaslovnes