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

clear_line not working with R console in tmux #154

Open
awoodx opened this issue Jun 24, 2024 · 5 comments
Open

clear_line not working with R console in tmux #154

awoodx opened this issue Jun 24, 2024 · 5 comments
Labels
wontfix This will not be worked on

Comments

@awoodx
Copy link

awoodx commented Jun 24, 2024

Having the R console in a separate tmux pane works better for my workflow, and I saw the recent tmux issue (#152). My R session works with tmux, but the clear_line option doesn't work. When I run a line in R, it appends to the text in the R console.

This is my R config:
local opts = { clear_line = true, external_term = "tmux split-window -hf " }

@jalvesaq
Copy link
Member

I can't replicate the issue. R.nvim reads my ~/.inputrc and correctly recognizes that my editing_mode should be "vi". When running R in a Tmux split pane, if there is any text in the R prompt, it is cleared when a command is sent.

@jalvesaq
Copy link
Member

I also have this in my ~/.config/tmux/tmux.config:

set-window-option -g mode-keys vi

This in my ~/.bashrc:

set -o vi

And this in ~/.config/fish/config.fish:

fish_vi_key_bindings

@awoodx
Copy link
Author

awoodx commented Jun 24, 2024

yes, I agree. The issue might not be related to tmux, but I do see instances where there clear_line isn't working, but I'm not able to reliably reproduce it. I will report back if I can a repro. Thanks!

@awoodx
Copy link
Author

awoodx commented Jun 24, 2024

I think I found a way to reproduce it, it's related to the Escape key in emacs mode.

  1. use emacs keys: set editing-mode emacs in ~/.inputrc
  2. start Nvim, and launch R console in a separate tmux pane.
  3. Type some text (eg garbage) in the R console followed by the Escape key.
  4. Switch back to nvim, and select a line of text to R.

The garbage text isn't cleared.

@jalvesaq
Copy link
Member

I can replicate the issue following your four steps. To be sure that I would be in "pure" emacs mode, I removed the vi mode from all configuration files (.inputrc, .bashrc, tmux.conf, and config.fish).

Of course, (n)vi(m) users inadvertently type the <Esc> key everywhere. However, I guess that we can't fix the issue in this case because Neovim has no way of knowing that the <Esc> key was typed on the R console.

@jalvesaq jalvesaq added the wontfix This will not be worked on label Jul 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
wontfix This will not be worked on
Projects
None yet
Development

No branches or pull requests

2 participants