Closed ayorgo closed 11 months ago
I definitely prefer having a way to automatically detect an interactive environment, mainly because the current heuristic makes it really easy to forget the -i
during startup. I didn't really expect that people would use this in combination with ipython's console, but adding support this way seems like a good idea.
The docs for sys.ps1
say that existence of these attributes implies an interactive environment. Because I'm not sure that the absence of these attributes also implies a non-interactive environment, I'm likely going to retain the current heuristic as a fallback in case sys.ps1
isn't defined.
Changes from the PR were merged into cbe4fe231d758b945c73ab89aee458acb12255d3.
This addresses #12 by using![image](https://github.com/jktr/matplotlib-backend-kitty/assets/3997638/5796adc7-2acc-47f8-b99a-d4858d16c714)
sys.ps1
as a heuristic for interactive shell according to the table below (courtesy of this SO answer).