question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Debugging on OSX with iTerm as external terminal creates a new window each time

See original GitHub issue

Issue Type: Bug

I don’t know whether this should count as a bug report or a feature request, but since the behaviour differs between Terminal and iTerm I’ve filed it as a bug.


To reproduce, simply start a debugging session using the following settings:

  • settings.json
  "terminal.explorerKind": "external",
  "terminal.external.osxExec": "iTerm.app",
  • launch.json
   "console":"externalTerminal",

This will send the command to start the debugging server and execute the program to iTerm, but it will create a new window and session each time, regardless of whether there are any existing windows open, including windows created from previous debugging sessions.

The expected behavior is to use the same terminal session when debugging the same program multiple times. This is also in line with how Terminal behaves when it is used as the external terminal, as successive debugging attempts will use the same window/session as previous runs.


VS Code version: Code 1.62.2 (3a6960b964327f0e3882ce18fcebd07ed191b316, 2021-11-11T20:59:05.913Z) OS version: Darwin x64 19.6.0 Restricted Mode: No

System Info
Item Value
CPUs Intel® Core™ i5-7360U CPU @ 2.30GHz (4 x 2300)
GPU Status 2d_canvas: enabled
gpu_compositing: enabled
metal: disabled_off
multiple_raster_threads: enabled_on
oop_rasterization: enabled
opengl: enabled_on
rasterization: enabled
skia_renderer: disabled_off_ok
video_decode: enabled
webgl: enabled
webgl2: enabled
Load (avg) 8, 6, 5
Memory (System) 16.00GB (0.10GB free)
Process Argv –crash-reporter-id e272faef-ec57-439e-960e-46857511d6ef
Screen Reader no
VM 0%

Issue Analytics

  • State:open
  • Created 2 years ago
  • Reactions:1
  • Comments:9 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
roeeklcommented, Feb 9, 2022

So I read about the Python API and I don’t think it will be any better.
First of all , to use Python API it you are required to enable this option in iTerm settings.
Moreover, according to this example of launching iTerm2, the script is required having Python + iterm2 and pyobjc packages.

I’m thinking that implementing @willdhorn AppleScript with a warning that recommends enable iTerm’s shell integration that will be shown first on the new opened session will be fine. I will also be happy to help implementing and testing it 😃 (I have Apple Silicon).

1reaction
weinandcommented, Feb 1, 2022

Starting with Monterey there is no longer Python installed on macOS. But feel free to submit a PR for this feature 😉

Read more comments on GitHub >

github_iconTop Results From Across the Web

Documentation - iTerm2 - macOS Terminal Replacement
If you want to open more that one session at a time, you have a few options: You can create a new window...
Read more >
Change default debugging console terminal app to iTerm2
I'd like to know whether (and how) to change the default terminal application spawned by VS Mac when debugging on external console. I'm...
Read more >
How can I use the same / existing external terminal (session ...
This problem only exists with iTerm, as everything works as expected with Terminal and the existing session is used for successive run/debug ......
Read more >
How do I speed up new Terminal tab loading time?
When you create a new Terminal tab, you are going through the login process. The process involves fetching various information about your ...
Read more >
Mac OSX Terminal (command-line tips and tricks) - Wilson Mar
Press command+space keys (at the same time) to bring up Apple's ... when a new terminal is opened, and when a bash shell...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found