Closed kyleskrinak closed 8 years ago
Hey. Forgive my surprise, never thought anyone would actually bother to try this. :D Anyway, binary encode and decode were introduced in tcl 8.6, I'm guessing you're on tcl 8.5?
Yes, 8.5.9 is what's on MacOSX 10.11.5, though I can load 8.6.4 using brew, which I've done. I'll test again later, thanks! Oh, and you're gaining attention: http://superuser.com/q/261689/85141
Heh, that is so cool. Anyway, I don't have a mac so I can't really test it, but please let me know how it goes. I'll update the readme when I get home on Sunday, to note the 8.6 dependency.
Closer:
/usr/local/bin/tclsh8.6 ~/.vim/bundle/ghost-text-vim/ghost-text-server.tcl
Caught exception: VIM - Vi IMproved 7.4 (2013 Aug 10, compiled Jun 10 2016 09:02:28)
Unknown option argument: "--servername"
More info with: "vim -h"
From what I can tell, vim needs to be compiled with +clientserver
, which appears to be standard on most platforms, but mac is a weird ecosystem w.r.t. vim.There's something called macvim, is that what you're using?
MacVim is what I mostly use. I tried removing and reinstalling vim/MacVim with the client-server option. I get further, but still no cigar. I now see:
Exception while closing VIm: No display: Send failed.
Caught exception: No display: Send expression failed.
As you've guessed gvim invokes macvim. If I change 'gvim' to 'vim' I can invoke vim but get the above message, anyhow. I can confirm with both vim and MacVim I see "+clientserver" after running ":version"
Right, what I gather from my research is that macvim supports clientserver if the GUI is running but not when running on the console. VIm traditionally uses a some X11 stuff to do the clientserver communication, and it appears macvim does it somehow differently. Out of curiosity, does
gvim --servername test
and/or
mvim --servername test
give you errors?
if the first one gives you the error (with the unknown option argument), and the second one works I'm guessing gvim is a wrapper of some sort, and we can probably use mvim.
I'm sorry for all the back and forth.
No apologies necessary! To be thorough, I first ensure there's no Vim/MacVim process running, i.e.,
ps aucx | grep -i vim
Returns an empty result. Then
gvim --servername test
Launches a process for Vim and MacVim, and no errors returned. Without quitting those, running
mvim --servername test
Launches a new Vim process. From the Mac UI side, it simply adds a new buffer/window to MacVim. Again, no CLI errors.
I think I'm onto something, with the macvim client/server stuff not working in the console version, I think the issue is the vim-send and vim-expr functions where I have assumed the cli version can send messages to the gui version. Could you change the two lines:
proc vim-send {name msg} { exec vim --servername $name --remote-send $msg }
proc vim-expr {name expr} { exec vim --servername $name --remote-expr $expr }
change exec vim
to exec gvim
, i.e. make them read:
proc vim-send {name msg} { exec gvim --servername $name --remote-send $msg }
proc vim-expr {name expr} { exec gvim --servername $name --remote-expr $expr }
And see if that helps?
That more than helps — that made all the difference. I am responding using your vim integration now to type my update into the comment field. Fantastic, thank you!
Excellent, I'll run a few tests to make sure it runs well on linux as well, and I can't see why it shouldn't, if that works I'll just use that instead.
When running the tcl script on Mac, and trying to invoke the server, I see: