The VSCodeVim team prioritizes issues based on reaction count.
Is this a BUG REPORT or FEATURE REQUEST? (choose one):
Environment:
What happened:
Several vim keys don't work as they are supposed to when VSCode is opened using the command line.
An example of one such command is dd. Nothing happens at all (I can see dd being logged in the lower panel in normal mode, but nothing happens).
What did you expect to happen:
When pressing dd in normal mode, I expect the current line to be cut.
How to reproduce it:
code . in any directory).dd in normal mode. I tested this on linux and there is no problem. So the issue is certainly tied to Mac OS.
When I open VSCode using the lancher, everything works as it's supposed to. So yeah, super strange!
Thanks in advance!
This...doesn't make any sense. I open through the cmd line all the time and have not seen this repro.
You say dd doesn't work, but what about other functionality?
@jpoon I totally hear ya! And I _toooootally_ agree that this sounds insane.
The macbook is my secondary machine so I don't spend that much time on it. IIRC, it was a handful of random commands for manipulating text in normal mode. The one that stuck out was the d command though since I use that so often.
Some commands that I can say did work fine were v, V, and pretty much all the navigation commands.
I'd be happy to help troubleshoot in any way if needed. What information can I get you? Want me to just run through all the common vim commands and make a list what doesn't work?
@jpoon I get this error when triggering dd when I open vscode from the command line....
extensionHost.ts:285 [Extension Host] error.stack
extensionHost.ts:285 [Extension Host] Error
at Function.module.exports.sync (/Users/dsifford/.vscode/extensions/vscodevim.vim-0.7.0/node_modules/execa/index.js:277:26)
at Object.copySync (/Users/dsifford/.vscode/extensions/vscodevim.vim-0.7.0/node_modules/clipboardy/index.js:21:26)
at Object.exports.writeSync.input [as writeSync] (/Users/dsifford/.vscode/extensions/vscodevim.vim-0.7.0/node_modules/clipboardy/index.js:112:13)
at Object.clipboardCopy (/Users/dsifford/.vscode/extensions/vscodevim.vim-0.7.0/out/src/util.js:33:16)
at Function.putNormalRegister (/Users/dsifford/.vscode/extensions/vscodevim.vim-0.7.0/out/src/register/register.js:153:18)
at Function.put (/Users/dsifford/.vscode/extensions/vscodevim.vim-0.7.0/out/src/register/register.js:75:26)
at DeleteOperator.<anonymous> (/Users/dsifford/.vscode/extensions/vscodevim.vim-0.7.0/out/src/actions/operator.js:121:37)
at Generator.next (<anonymous>)
at /Users/dsifford/.vscode/extensions/vscodevim.vim-0.7.0/out/src/actions/operator.js:13:71
at __awaiter (/Users/dsifford/.vscode/extensions/vscodevim.vim-0.7.0/out/src/actions/operator.js:9:12)
at DeleteOperator.delete (/Users/dsifford/.vscode/extensions/vscodevim.vim-0.7.0/out/src/actions/operator.js:85:16)
at DeleteOperator.<anonymous> (/Users/dsifford/.vscode/extensions/vscodevim.vim-0.7.0/out/src/actions/operator.js:149:30)
at Generator.next (<anonymous>)
at /Users/dsifford/.vscode/extensions/vscodevim.vim-0.7.0/out/src/actions/operator.js:13:71
at __awaiter (/Users/dsifford/.vscode/extensions/vscodevim.vim-0.7.0/out/src/actions/operator.js:9:12)
at DeleteOperator.run (/Users/dsifford/.vscode/extensions/vscodevim.vim-0.7.0/out/src/actions/operator.js:148:16)
extensionHost.ts:285 [Extension Host] Error
at Function.module.exports.sync (/Users/dsifford/.vscode/extensions/vscodevim.vim-0.7.0/node_modules/execa/index.js:277:26)
at Object.copySync (/Users/dsifford/.vscode/extensions/vscodevim.vim-0.7.0/node_modules/clipboardy/index.js:21:26)
at Object.exports.writeSync.input [as writeSync] (/Users/dsifford/.vscode/extensions/vscodevim.vim-0.7.0/node_modules/clipboardy/index.js:112:13)
at Object.clipboardCopy (/Users/dsifford/.vscode/extensions/vscodevim.vim-0.7.0/out/src/util.js:33:16)
at Function.putNormalRegister (/Users/dsifford/.vscode/extensions/vscodevim.vim-0.7.0/out/src/register/register.js:153:18)
at Function.put (/Users/dsifford/.vscode/extensions/vscodevim.vim-0.7.0/out/src/register/register.js:75:26)
at DeleteOperator.<anonymous> (/Users/dsifford/.vscode/extensions/vscodevim.vim-0.7.0/out/src/actions/operator.js:121:37)
at Generator.next (<anonymous>)
at /Users/dsifford/.vscode/extensions/vscodevim.vim-0.7.0/out/src/actions/operator.js:13:71
at __awaiter (/Users/dsifford/.vscode/extensions/vscodevim.vim-0.7.0/out/src/actions/operator.js:9:12)
at DeleteOperator.delete (/Users/dsifford/.vscode/extensions/vscodevim.vim-0.7.0/out/src/actions/operator.js:85:16)
at DeleteOperator.<anonymous> (/Users/dsifford/.vscode/extensions/vscodevim.vim-0.7.0/out/src/actions/operator.js:149:30)
at Generator.next (<anonymous>)
at /Users/dsifford/.vscode/extensions/vscodevim.vim-0.7.0/out/src/actions/operator.js:13:71
at __awaiter (/Users/dsifford/.vscode/extensions/vscodevim.vim-0.7.0/out/src/actions/operator.js:9:12)
at DeleteOperator.run (/Users/dsifford/.vscode/extensions/vscodevim.vim-0.7.0/out/src/actions/operator.js:148:16)
Again, no error when opening it from spotlight
@jpoon AHA!
I narrowed it down again... The error only occurs when I open vscode from the command line, using tmux.
Looks like this is a dup of #1314
Does that fix fix it?
Looking into some solutions. Has to do with a recent regression in OSX sierra. Will report back when I find a reasonable solution
@Chillee Found a pretty awesome fix. You might want to consider making a note of this somewhere for other OSX tmux users.
Full solution can be made in 3 steps. Those steps (in exhaustive detail) can be found here: https://github.com/ChrisJohnsen/tmux-MacOSX-pasteboard
In short:
$ brew install reattach-to-user-namespace
Paste the following into your tmux.conf file
# tmux.conf
set-option -g default-command "reattach-to-user-namespace -l $SHELL"
Kill all tmux servers and relaunch. Done ✅
$ tmux kill-server
$ tmux
Wow. That is ... bizarre. Great job debugging it!
Does it happen for all OSX users opening VSCode through tmux? That's what it sounds like, reading the linked github repo.
Yeah I think so (assuming they're running sierra).
Oh what the heck. Strange coincidence. I had a separate issue with tmux today, but the resolution was the same: http://www.elmund.io/osx/2015/07/10/open-command-in-osx-tmux/.
Strangely, even prior to fixing my .tmux.conf with this, I did not encounter the error that you experienced.
Most helpful comment
@Chillee Found a pretty awesome fix. You might want to consider making a note of this somewhere for other OSX tmux users.
Full solution can be made in 3 steps. Those steps (in exhaustive detail) can be found here: https://github.com/ChrisJohnsen/tmux-MacOSX-pasteboard
In short:
Step 1
Step 2
Paste the following into your
tmux.conffileStep 3
Kill all tmux servers and relaunch. Done ✅