Skip to content

Investigate shell integration in terms of Python REPL  #21966

Closed

Description

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

Activity

  1. modified the milestones: November 2023, on Nov 27, 2023
  2. removed this from the milestone on Dec 11, 2023
  3. added
    needs spikeLabel for issues that need investigation before they can be worked on.
    and removed
    triage-neededNeeds assignment to the proper sub-team
    on Dec 14, 2023
  4. locked as resolved and limited conversation to collaborators on Sep 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

area-replfeature-requestRequest for new features or functionalityneeds spikeLabel for issues that need investigation before they can be worked on.

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions