jalvesaq/vimcmdline

Problems tmux and kitty as terminal

Closed this issue · 7 comments

I use kitty as my terminal emulator, with Neovim as my editor. I typically use NVim-R for R code, which works perfectly. I just tried to get vimcmdline working to let me have a similar setup to play with Julia, but I'm running into errors.

vimcmdline works fine if I set my terminal to, say, xterm, but for some reason I'm getting errors (apparently related to the tmux configuration file) when I try the same in ktty.

With let cmdline_external_term_cmd = "kitty '%s' &" I get:

Failed to launch child: tmux -2 -f "/tmp/cmdline_1573890709_joss/tmux.conf" -L VimCmdLine new-session -s vcl1573890710 julia
With error: No such file or directory
Press Enter to exit.

For convenience, I often use a wrapper command terminal to run kitty, which just contains kitty $* at the moment. When I set let cmdline_external_term_cmd = "terminal '%s' &" I instead get:

"/tmp/cmdline_1573890503_joss/tmux.conf": No such file or directory 

In the second case, the REPL does then appear, and I can send code to it from Neovim, but the tmux configuration file is clearly not being read, and causes an error. I've checked, and the tmux configuration file is being created.

Thinking it might be some kind of timing issue, I changed my terminal command to sleep 1; kitty $*, but that had no effect.

On that note, under NVim-R I much prefer to use my own .tmux.conf, and so have the let R_notmuxconf = 1 option set. Is there something similar available for vimcmdline? If not, would it be possible to have it?

Thank you.

Just as a follow up, the command line that's being generated (as seen in ps -ef) is:

kitty tmux -2 -f "/tmp/cmdline_1573891632_joss/tmux.conf" -L VimCmdLine new-session -s vcl1573891673 julia

If I remove the -f "/tmp/cmdline_1573891632_joss/tmux.conf" and run the command myself, it works perfectly.

I added a new option to allow users to define their own tmux.conf: cmdline_tmux_conf. Can you solve the problem by writing a custom tmux.conf?

Thanks for the (amazingly!) quick response.

The cmdline_tmux_conf option is great for me, but unfortunately I'm still getting the same error:

Failed to launch child: tmux -2 -f "/home/tealeaf/.tmux.conf" -L VimCmdLine new-session -s vcl1573910292 julia
With error: No such file or directory
Press Enter to exit.

The strange thing, again, is that however NVim-R is calling this is working for that plugin, but whatever vimcmdline is doing is resulting in this odd error. (It may well be something odd in how kitty handles things, but the fact that NVim-R works is making me hopeful that I can fix it here.)

When I open a kitty window and manually run tmux -2 -f "/home/tealeaf/.tmux.conf" -L VimCmdLine new-session -s vcl1573910292 julia it works fine.

Incidentally, for NVim-R I just have:

let R_term_cmd = "kitty"

If I set:

cmdline_external_term_cmd="kitty"

Then I get:

Error detected while processing function VimCmdLineStartApp[13]..VimCmdLineStart_ExTerm:      
line   35:
E767: Too many arguments to printf()

Not sure if that's relevant, but I thought I'd mention it.

I've just had a poke around, and removing the -f "' . tconf . '" from line 126 of vimcmdline.vim doesn't fix this. I still get the same error.

I'm now trying to work out exactly which file kitty thinks is missing!

I installed kitty... It doesn't like the quotes. Please, try:

let cmdline_external_term_cmd = 'kitty %s &'

Oh, thank you so much!