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

Send code to terminal tab in editor group #682

Closed
renkun-ken opened this issue Jun 25, 2021 · 12 comments
Closed

Send code to terminal tab in editor group #682

renkun-ken opened this issue Jun 25, 2021 · 12 comments
Labels

Comments

@renkun-ken
Copy link
Member

microsoft/vscode#10546 allows user to move integrated terminal to editor group, which is included in the latest insider build.

However, "Run selection" does not seem to work with the terminal tabs. We might need to take a look at the related API.

image

@renkun-ken
Copy link
Member Author

The Terminals in the editor area is released, looks like we need to support it now.

@ElianHugh
Copy link
Collaborator

On my end, it looks like sending code to the editor terminal does work, but vscode-R then attempts to focus the old terminal panel. Seems like term.show is being weird

@renkun-ken
Copy link
Member Author

Yes, same here, it will unnecessarily reveal the terminal pane, which then gets the focus and sending to active terminal will send code to the shell in terminal instead of the R terminal. Focus again on the R terminal and then things will work as usual.

Is there a way to determine if the terminal is in editor? If so, we should reveal the editor tab instead of the terminal pane.

@ElianHugh
Copy link
Collaborator

Right.

I've had a look around and I haven't had any luck in determining where the terminal is. vscode.window.terminals & vscode.window.activeTerminal don't have any location information, and terminals don't show up in vscode.visibleTextEditors

@MilesMcBain
Copy link
Collaborator

I had a look at this too and found the same @ElianHugh, there seems to be no way via the API at the moment to identify terminals that are open in the editor area.

What I did notice is that if I avoid running show() by setting option source.focus = "none" then I can send code an editor area terminal without it popping the terminal panel.

So that should mostly work, but if user accidentally opens a new file in the same group as the terminal it could get hidden and not auto show. I noticed there is discussion on the VSCode repo to create the ability to lock editor groups to avoid this: microsoft/vscode#124709

I couldn't find a bug report about the show() behaviour, so I am going to make one.

@MilesMcBain
Copy link
Collaborator

Another annoying thing I just noticed is that if the user sets terminal.integrated.defaultLocation = editor then new terminals get created 'over the top' of the current text document that has focus in the editor group.

@MilesMcBain
Copy link
Collaborator

Created feature request for option to avoid opening editor area terminals on top of active text editor: microsoft/vscode#129172

@MilesMcBain
Copy link
Collaborator

MilesMcBain commented Jul 22, 2021

It seems the show() bug is already fixed (not yet released) and they have added to feature request to their current backlog which is encouraging.

@renkun-ken
Copy link
Member Author

I tried the latest insider and it works now, but sending code to terminal in editor is still a bit buggy. For example, once we show the terminal and execute "Terminal: Move terminal into editor area", sending code to active terminal might not work at first, then focus the terminal in editor and get back to the editor, and then send code again, now it should work.

@MilesMcBain
Copy link
Collaborator

It sounds like we need to make a new bug report!

@github-actions
Copy link

This issue is stale because it has been open for 365 days with no activity.

@github-actions github-actions bot added the stale label Jul 23, 2022
@github-actions
Copy link

github-actions bot commented Aug 7, 2022

This issue was closed because it has been inactive for 14 days since being marked as stale.

@github-actions github-actions bot closed this as completed Aug 7, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants