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

tmux3.3 upgrade -- inline plotting #101

Open
nikisix opened this issue Oct 26, 2023 · 2 comments
Open

tmux3.3 upgrade -- inline plotting #101

nikisix opened this issue Oct 26, 2023 · 2 comments

Comments

@nikisix
Copy link
Contributor

nikisix commented Oct 26, 2023

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
Copy link
Contributor Author

nikisix commented Oct 26, 2023

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
Copy link
Contributor Author

nikisix commented Oct 31, 2023

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant