Closed xanderdunn closed 9 years ago
Are you using clipboard=unnamedplus
? There's a known issue with clipboard, at the moment.
Oh, but the job control message is weird, haven't seen that before. I assume it's a terminal control sequence that is getting wrongly interpreted.
It looks like I'm using clipboard=unnamed
Ok, try without that. See #1690
Does the same problem occur if you use CMD+V? Any different results if you :set paste
before pasting?
Without clipboard=unnamed,
Pressing p inserts the same bash error text, without any of my copied text:
Command+V sucessfully pastes my text with no bash error, but it cuts off the beginning of it: However, I notice the same cutting off behavior in vim, so this is not NeoVim-specific bug.
Being in :set paste mode has no effect on either's behavior.
Thanks!
I noticed set shellcmdflag=-ic
in your vimrc, that can be a problem. Try removing that line and restarting nvim.
Interactive shell is definitely a test case I don't think we have bothered with yet. It would be great to support it though (aliases and stuff). It has a history of problems on Vim, I don't know if it is for technical reasons or just historical.
I don't know why that would cause your issue though, I should go to bed...
Interactive shell is definitely a test case I don't think we have bothered with yet. ... It has a history of problems on Vim, I don't know if it is for technical reasons or just historical.
I don't think this is unique to Vim. The shell is being told to run interactively, so it expects to be running interactively. I wager you'd see similar behavior from any other program that let's you execute commands through a non-interactive shell but lets you tell the shell it should be interactive.
@jamessan You are right. I was thinking about this some more, and reviewed some other threads. The only way to robustly support "interactive" shell is to actually open a shell (in a terminal emulator or tmux pane).
Incidentally it would be nice to have good support for this in n/vim, because making the user's aliases etc. available is part of the "unix as IDE" philosophy.
The only way to achieve this is either with (1) a "strategy" collection like gtfo.vim or dispatch.vim, or (2) by actually hosting a terminal emulator in a Neovim window. The thought of hacking together support for all the various terminals makes (2) actually look somewhat appealing...
or (2) by actually hosting a terminal emulator in a Neovim window. The thought of hacking together support for all the various terminals makes (2) actually look somewhat appealing...
Do you mean running a terminal emulator or implementing one? If the latter, then I strongly suggest otherwise. Vim (:shell
in gvim) and Emacs have both done this (with more success in Emacs) but they're both awful.
Incidentally it would be nice to have good support for this in n/vim, because making the user's aliases etc. available is part of the "unix as IDE" philosophy.
Isn't that better served by actually using the tool for what it's designed for? If the command isn't being run for the benefit of Vim, then do it from an actual terminal. If it is, then either type out what you mean (for one-offs) or script it.
I guess I'm a bit of a luddite in that regard, though. I never got into aliases, so don't have the issue that so many other people seem to run into.
Vim (:shell in gvim) and Emacs have both done this (with more success in Emacs) but they're both awful.
The idea has been floated and although I have not much interest in working on it, I'll be happy to see how close others can get. I agree though, eshell, ansiterm, in emacs are unbearable. Maybe it would be better to work on improving integration with tmux.
I guess I'm a bit of a luddite in that regard, though. I never got into aliases,
It's not that aliases are so important but that the user is able to use the shell as an extension in harmony with the editor. I am most interested in enabling acme-like workflows where the editor is used to craft commands and there's a feedback loop. The shell should be a REPL for your OS.
Vim (:shell in gvim) and Emacs have both done this (with more success in Emacs) but they're both awful. The idea has been floated and although I have not much interest in working on it, I'll be happy to see how close others can get. I agree though, eshell, ansiterm, in emacs are unbearable. Maybe it would be better to work on improving integration with tmux.
While implementing a terminal emulator from the scratch would be a bad idea, libvterm implements the most complicated parts of a full featured terminal emulator while exposing a pluggable input/output system. That fits perfectly with Neovim job control system(though it still needs to be enhanced to allow spawning jobs with pty).
When I'm done fiddling with the UI, integrating libvterm will be my next task, I will use to create an experience similar to vimshell
Yes, it was my desire to run shell commands (including all my many aliases) while in vim that lead me down the path of:
set shell=bash\ --login
set shellcmdflag=-ic " :! commands will now occur in interactive shell (bash)
I just updated NeoVim to: NVIM 0.0.0-alpha+201501021831 (compiled Jan 3 2015 09:48:55) Commit: d61111530541f74df89c010e5edfb633a412dc72
and I had to remove the above two lines from my .vimrc. I was seeing all kinds of weird problems that made nvim unusable. On first executing nvim
, it would be stopped by bash. Then I would start the process with fg 1
, and it would seem fine. But, I would open a file :e ~/Desktop/test.shit
and it would stop drawing properly: key strokes would appear written in the bash prompt rather than take visual affect in nvim. All of these problems went away when I removed these two lines from my .vimrc.
As for this paste problem, I no longer see the bash control flow error text inserted into my buffer with the interactive shell disabled. However, I have the same ^M character insertion problem with I use p
instead of Command-V:
Resolved by :terminal
:)
Note that shellcmdflag=-ic
is still unsupported. Use :terminal
where interactive shell is needed.
After set shellcmdflag=-ic
, fugitive
plugin stopped working, just saying.
After set
shellcmdflag=-ic
,fugitive
plugin stopped working, just saying.
Only -i
should be removed. Or rather, remove shellcmdflag=-ic
from your config, because -c
is the default.
Mac OSX 10.10.1. I installed NeoVim using Homebrew exactly as described in the Wiki.
When I copy text from the Mac's Messages app and paste it into NeoVim by pressing p, it goes from looking like this:
To this:
I don't expect to see that bash error, or to have the new lines turned into ^M.
I'm using Terminal.app that comes with Mac OSX.
NeoVim :version
My .nvimrc