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

Attach to an external terminal for code execution #20483

Closed
jooyoungseo opened this issue Jan 9, 2023 · 9 comments
Closed

Attach to an external terminal for code execution #20483

jooyoungseo opened this issue Jan 9, 2023 · 9 comments
Labels
area-terminal feature-request Request for new features or functionality

Comments

@jooyoungseo
Copy link

Many blind programmers who use screen reader, including myself, open an external terminal and execute Python code there instead of VSCode's integrated terminal. There has been some discussion on making VSCode integrated terminal more accessible in the upstream repo; however, using an external terminal will remain a primary accessible go-to solution for blind programmers.

I understand that there is a way to launch an external console by setting up launch.json, but that's primarily for debugging. I was wondering if there would be any way to attach an external Python repl outside the VSCode and connect the console to VSCode so that users can interactively send Python code from VSCode to the attached external console.

tmux is an alternative solution, but setting it up on Windows platform would be quite tricky unless you use WSL or msys2/Cygwin.

Hopefully, this request could be considered for future improvement.

@jooyoungseo jooyoungseo added the feature-request Request for new features or functionality label Jan 9, 2023
@github-actions github-actions bot added the triage-needed Needs assignment to the proper sub-team label Jan 9, 2023
@karthiknadig
Copy link
Member

@jooyoungseo A workaround using launch.json, you can use this configuration to run without debugging, in an external terminal (it is just this set "noDebug": true,). You can also do this with ctrl+F5 shortcut (run without debugging), no need to add noDebug to config:

        {
            "name": "Run without debugging",
            "type": "python",
            "request": "launch",
            "program": "${file}",
            "console": "externalTerminal",
            "purpose": ["debug-in-terminal"],
            "justMyCode": true,
            "noDebug": true,
        }

@jooyoungseo
Copy link
Author

Thanks, @karthiknadig. However, this way does not allow line-by-line code execution in the same external terminal because it runs the current file entirely and is different from what I asked.

@karthiknadig karthiknadig added needs proposal Need to make some design decisions and removed triage-needed Needs assignment to the proper sub-team labels Jan 10, 2023
@brettcannon
Copy link
Member

We have talked about redoing our REPL support, which would allow for line-by-line execution. We don't have an ETA of when we would even start that work, but we will keep this issue open to make sure we keep this use case in mind when designing it.

@dzid26
Copy link

dzid26 commented Apr 23, 2023

Thanks, @karthiknadig. However, this way does not allow line-by-line code execution in the same external terminal because it runs the current file entirely and is different from what I asked.

How do you execute Python script line by line in the terminal?

@karthiknadig
Copy link
Member

@dzid26 if it is normal execution without debugging then you should be able to send current line to terminal using shift + enter
image

@cramsuig
Copy link

Almost another year. A reminder: having this feature would help blind programmers! And also would be really cool. I come from Atom and this was very handy, especially in a small screen or multiple-monitor setting.

@brettcannon
Copy link
Member

The only way I can think of to make this work is launching an external terminal which connects back to VS Code as a client/server, effectively setting up a remote REPL. If that's correct then that isn't a small ask as that involves a REPL from scratch.

And we aren't ignoring this, but we are still working on getting what we already have for REPL support just working appropriately. Once that's done (hopefully soon), we are going to rethink how we expose the REPL and I would expect that would have better accessibility since we would control the UI more directly instead of delegating to the terminal as much.

/cc @anthonykim1

@anthonykim1
Copy link

anthonykim1 commented Jan 26, 2024

Hello @jooyoungseo and @cramsuig
In regards to accessibility, would shell integration provide you with enough power so that you don't have to launch external Python REPL? (Referring to: microsoft/vscode#199102)

In this upcoming release, Mac and Linux Python REPL users should have access to shell integration's success, failure decorations and run recent command allowed. Unfortunately, command decoration for Windows users is still in the fix and recent command access would not be supported any time soon because of GNU readline dependency reason.
I am sure this shouldn't be big problem once we start building our own REPL from scratch, particularly for VS Code.

I think I have heard from some recording or session that there was accessibility concerns in terms of accessing traceback and outputs from the REPL as well as the command navigation. Is that correct? @jooyoungseo

@jooyoungseo
Copy link
Author

I think the recent improvement made in the terminal buffer (AKA, accessible view) has significantly addressed the long-standing accessibility issue and I personally feel okay we close this issue at this moment.

@github-actions github-actions bot removed the needs proposal Need to make some design decisions label Jan 29, 2024
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Feb 29, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area-terminal feature-request Request for new features or functionality
Projects
None yet
Development

No branches or pull requests

6 participants