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

[feature request] images in REPL #381

Open
rwijtvliet opened this issue Jun 24, 2024 · 1 comment
Open

[feature request] images in REPL #381

rwijtvliet opened this issue Jun 24, 2024 · 1 comment

Comments

@rwijtvliet
Copy link

rwijtvliet commented Jun 24, 2024

Running code in the ipython buffer created with iron, I noticed that images are not being drawn:

image

Whereas the same code in the terminal proper does draw the images:

image

From what I gather, there is an issue displaying images in the terminal buffer in vim. Yet, some plugins (e.g. magma) are able to draw images (maybe because they are not inside a terminal buffer?).

Either way, my feature request is to show images in ipython for sixel or kitty-image-protocol enabled terminals. Maybe using https://github.com/3rd/image.nvim ?

(I think it's not relevant, but my iron config in the first screenshot is:

      iron.setup {
        config = {
          scratch_repl = true,
          repl_definition = {
            sh = {command = { 'zsh' }},
            python = {
              format = require('iron.fts.common').bracketed_paste,
              command = { 'ipython', '-i', '--no-autoindent', '--nosep' },
            },
          },
          repl_open_cmd = require('iron.view').split.vertical.botright(0.40, {winfixwidth = false, winfixheight = false, number = true}),

PS: See this question on stackexchange for an overview of the options that I have tried.

@frere-jacques
Copy link

I had a look at your stackexchange question and looked at jupyter-vim.

If you are still interested in Iron, you can have the very same functionality with iron. Also with this setup you send multiline blocks as single execution.

Copied post from the discussion here #380 (comment):

python = {
  command = { "jupyter-console", "--ZMQTerminalInteractiveShell.image_handler=None" },
  format = require("iron.fts.common").bracketed_paste,
  block_deviders = { "# %%", "#%%" },
},

The option , "--ZMQTerminalInteractiveShell.image_handler=None" can be removed to get the jupyter-console default image display.

I had a look today at https://github.com/jupyter-vim/jupyter-vim. They open qtconsole in an extra window and attach it to the jupyter-console kernel. I can do now the same and can see the repl output like images in qtconsole while sending with iron code from my buffer to the python-console in the nvim buffer. This works even, if the iron buffer is hidden.

Just start the repl in iron and then in a different terminal run jupyter qtconsole --existing --ConsoleWidget.include_other_output=True or set this option in the config file, like instructed in jupyter-vim.

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

2 participants