Skip to content

Tweak Python terminal shell integration for lsp completion #25012

@anthonykim1

Description

@anthonykim1

In order to get the prompt input model working and terminal suggest, lsp suggestion for REPL, we need to tweak the shell integration on Python side.

Essentially just putting:


            result = "{command_executed}{command_line}{command_finished}{prompt_started}{prompt}{command_start}".format(
                command_executed="\x1b]633;C\x07",
                command_line="\x1b]633;E;" + str(get_last_command()) + "\x07",
                command_finished="\x1b]633;D;" + str(exit_code) + "\x07",
                prompt_started="\x1b]633;A\x07",
                prompt=original_ps1,
                command_start="\x1b]633;B\x07",
            )

will suffice.

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions