iago-lito / intim

Interactively interface Vim with interpreters
GNU General Public License v3.0
6 stars 2 forks source link

E484: Cannot open file /tmp/ #4

Closed simoncarrignon closed 5 years ago

simoncarrignon commented 6 years ago

Ok I get quickly stopped while trying to start the plugin:

Erreur détectée en traitant function <SNR>26_LaunchSession[9]..<SNR>26_System :
ligne    2 :
E484: Cannot open file /tmp/viUWgfu/2

I tried to fix it without success but while doing that I realize: you say you where inspired from vim-r-plugin, but looking at the sources they seem really different from the vim-r-plugin one. Thus I tried just to change R by python and source by the exec equivalent python function and it's working :D

( I wanted to use python3 so what I didn exactly was just do in the file common_global.vim:

:%s/\<R\>/python3/g
:%s/base::source(/exec(open(/g

)

Honestly I think I will follow this path as I am really use to vim-r-plugin shortcuts, with lot of tmux custom stuff too, it seems very straight forward like this (for exemple \rc vs your F10, or the fact that by default I think you remap the vim ctrl+D comand to something else...)

you can try what I did here : https://github.com/simoncarrignon/Vim-R-plugin

simoncarrignon commented 6 years ago

hm I realized that the repository I forked is an odl one, I should have used this : https://github.com/jalvesaq/Nvim-R The implementation has changed someone so it wont be so straightforward to adapt it but I will try.

iago-lito commented 6 years ago

Hey. Welcome and thanks for your interest in Intim :)


you say you where inspired from vim-r-plugin, but looking at the sources they seem really different from the vim-r-plugin

Sure. I have been inspired from vim-R-plugin specifications, but this is a complete rewrite.


E484: Cannot open file /tmp/viUWgfu/2

Cannot reproduce. Can you show me your Intim configuration (if any) and the outputs of:

:echo <SNR>26_terminal()<cr>
:echo <SNR>26_sname()<cr>
:echo <SNR>26_get_preInvokeCommands()<cr>

(note: I wrote 26_ because it is the number that shows up in your error message. This number may change if your have installed other plugins since then. Please use the most recent one.)

Plus: do you have any idea what this /tmp/viUWgfu/2 is on your machine or your configuration? It is never explicitly targetted by Intim.


I wanted to use python3

For this, slacking:

call Intim_invokeCommand('python', 'python3')

in your .vimrc should be enough, see :help intim-starting. ;)

I am really use to vim-r-plugin shortcuts

Any shortcut can be remapped of course, with the <Plug>Intim* entry points.

by default I think you remap the vim ctrl+D comand

Intim does not remap anything user had mapped before. However, I agree that overriding the basic <c-D> was quite not a good move (I personally use <m-D> instead). I'll change this asap ;)

iago-lito commented 6 years ago

Plus: do you have any idea what this /tmp/viUWgfu/2 is on your machine or your configuration? It is never explicitly targetted by Intim.

Wop. Update on that: I think /tmp/viUWgfu/2 is a kind of path used by tmux, and that this error may be related to tmux not understanding the command it is supposed to send to IntimSession.
What version of tmux are you currently running?

iago-lito commented 6 years ago

I agree that overriding the basic <c-D> was quite not a good move

Fixed in be2a927, defaulting to <c-e> to send the EOF signal instead of <c-d>.

simoncarrignon commented 6 years ago

My tmux version:

$ tmux -V
tmux 2.3

I just donwload the last github version (thanks for re-maping :) ! ). I still have the same error with same number (26) and While trying the echo command you told me to do, they all gave me E121: Undefined variable: cr, cf:

E121: Undefined variable: cr
E15: Invalid expression: <SNR>26_get_preInvokeCommands()<cr>
Press ENTER or type command to continue

Not sure if I will have time try more things with the plugin this week as I have to finish some stuff, but thank for loonking at my problem!

iago-lito commented 6 years ago

Well, I have the same tmux version which should be okay.

As for the commands, <cr> is only vim idiom to say "press enter". I should have made it explicit, sorry for that. The plain commands are:

echo <SNR>26_terminal()
echo <SNR>26_sname()
echo <SNR>26_get_preInvokeCommands()

So, to send them, you have to explicitly-type-on-your-keyboard:

:echo <SNR>26_terminal()↵
:echo <SNR>26_sname()↵
:echo <SNR>26_get_preInvokeCommands()↵
simoncarrignon commented 6 years ago

:D ok sorry my bad, I should have tried that. Thus the result are:

gnome-terminal                                                                                                                                                                                                               
IntimSession
['']
iago-lito commented 6 years ago

Thank you. Well. These are the expected default options. I still cannot reproduce your problem. Can you describe in detail the successive steps that lead you to this error? What I personally do is:

Do you use anything different on your side? And if yes, what? :)

Is your vim terminal already tmuxed somehow?

Thank you for your patience.

tleonardi commented 6 years ago

I had the same issue, and I think the cause is at lines 637-638 of intim.vim:

let launchCommand = s:terminal()
   \ . " -e 'tmux -2 new -s " . s:sname() . "' &;"

The semicolon at the end of the command is invalid syntax in Bourne shells such as bash.

This fixed it for me:

let launchCommand = s:terminal()
   \ . " -- tmux -2 new -s " . s:sname() . " &"

Using the -- sytnax for the tmux command suppresses a warning raised by -e.

iago-lito commented 6 years ago

@tleonardi Well, cheers for that. I cannot test it this week, but feel free to offer your fix as a pr :)

iago-lito commented 6 years ago

@simoncarrignon Pr #9 is supposed to fix it. Do you confirm? :)

iago-lito commented 5 years ago

Closing this as fix non-confirmed for more than 1 year.