Change behaviour with VS Code

43 views
Skip to first unread message

david.ste...@gmail.com

unread,
Nov 2, 2021, 8:22:41 PM11/2/21
to iterm2-discuss
I tend to load files into VS Code via the command-line, My starting point is to go into  a dec directory and type "code ."

This starts up VS Code, and loads the current directory into the file browser.

As of the latest iTerm2, it correctly starts up VS Code (or creates a new window if already open), but VS Code does not come to the front! This is new behaviour, and it's a right royal pain.  

$EDITOR is set to "/usr/local/bin/code -w", so when I need to add a git commit msg, I used to just do "git commit ..." and start typing. But now the typing isn't going to VS Code as it's no longer brought to the front.

In contrast, the Apple Terminal.app still behaves correctly, it opens VS Code and brings it to the front. Like iTerm2 used to.

An intentional change?  I hope not :)

Thanks for all your efforts on this fantastic tool.

David Stevenson

unread,
Nov 2, 2021, 8:26:40 PM11/2/21
to iterm2-...@googlegroups.com

Typos, subject should be “Changed…” and “dec” should be “dev”…

--
You received this message because you are subscribed to the Google Groups "iterm2-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to iterm2-discus...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/iterm2-discuss/0e1b0a00-ec74-487a-aa39-7d414cb82c62n%40googlegroups.com.

David Stevenson

unread,
Nov 4, 2021, 10:39:19 PM11/4/21
to iterm2-...@googlegroups.com
It seems like it's probably not a VS Code (or 'open') problem due to working ok with Apple's Terminal.app

Anyone else able to reproduce this, latest official releases of VS Code, macOS, and iTerm2?

David Stevenson

unread,
Nov 4, 2021, 10:59:43 PM11/4/21
to iterm2-...@googlegroups.com
Same behaviour with TextMate 2 and latest iTerm2

Richard Mitchell

unread,
Nov 5, 2021, 9:16:37 AM11/5/21
to iterm2-discuss

From reading the iTerm2 gitlab issues, several people are reporting similar issues - if they open another app with iTerm2 in the foreground, the other app is displayed underneath.  It also, if I have understood correctly, seems to be new to Monterey but specific to iTerm2 and not Terminal.  This suggests Apple has changed something in their API that requires a change in programs using it.

George Nachman

unread,
Nov 5, 2021, 7:30:51 PM11/5/21
to iterm2-...@googlegroups.com
If you’re running the command at the command line, it’s unlikely that iTerm2 is responsible. Does Terminal.app exhibit the same behavior? Would it be any different if you did EDITOR=`open /usr/local/bin/code -w`?

David Stevenson

unread,
Nov 5, 2021, 11:57:12 PM11/5/21
to iterm2-...@googlegroups.com
As I stated, it’s fine in Terminal.app

George Nachman

unread,
Dec 3, 2021, 2:48:56 PM12/3/21
to iterm2-...@googlegroups.com
The reason for this is that secure keyboard entry is turned on. It’s a menu item under iTerm2. This seems to be a change in Monterey, presumably for security purposes.

Reply all
Reply to author
Forward
0 new messages