Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Investigate shell integration in terms of Python REPL #21966

Closed
anthonykim1 opened this issue Sep 11, 2023 · 0 comments
Closed

Investigate shell integration in terms of Python REPL #21966

anthonykim1 opened this issue Sep 11, 2023 · 0 comments
Assignees
Labels
area-repl feature-request Request for new features or functionality needs spike Label for issues that need investigation before they can be worked on.

Comments

@anthonykim1
Copy link

anthonykim1 commented Sep 11, 2023

Investigate into VS Code's shell integration and how it can be used in terms of Python REPL.

Success/Failure decoration can be implemented by defining our own .pythonrc file and then having environment variable PYTHONSTARTUP to point to the .pythonrc file.

Leverage PYTHONSTARTUP:
PYTHONSTARTUP = "If this is the name of a readable file, the Python commands in that file are executed before the first prompt is displayed in interactive mode. The file is executed in the same namespace where interactive commands are executed so that objects defined or imported in it can be used without qualification in the interactive session."

Leverage sys.ps1 and sys.ps2:
"If a non-string object is assigned to either variable, its str() is re-evaluated each time the interpreter prepares to read a new interactive command; this can be used to implement a dynamic prompt"
This is great, since it means we can inject sequences like exit code that is needed to get the shell integration decoration show up for Python REPL in VS Code.

Related or blocked by:
microsoft/vscode#202299
microsoft/vscode#199770
microsoft/vscode#155530

@anthonykim1 anthonykim1 added feature-request Request for new features or functionality area-repl labels Sep 11, 2023
@anthonykim1 anthonykim1 added this to the September 2023 milestone Sep 11, 2023
@anthonykim1 anthonykim1 self-assigned this Sep 11, 2023
@github-actions github-actions bot added the triage-needed Needs assignment to the proper sub-team label Sep 11, 2023
@anthonykim1 anthonykim1 mentioned this issue Oct 22, 2023
24 tasks
@brettcannon brettcannon modified the milestones: November 2023, December 2023 Nov 27, 2023
@joaomoreno joaomoreno removed this from the December 2023 milestone Dec 11, 2023
@luabud luabud added needs spike Label for issues that need investigation before they can be worked on. and removed triage-needed Needs assignment to the proper sub-team labels Dec 14, 2023
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Sep 21, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area-repl feature-request Request for new features or functionality needs spike Label for issues that need investigation before they can be worked on.
Projects
None yet
Development

No branches or pull requests

4 participants