-
Notifications
You must be signed in to change notification settings - Fork 130
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
Error identifying terminal #385
Comments
Hi @bersbersbers, thank you for reporting this. When I hit F5 (command 'Debug: Start Debugging'), I get a popup 'Select Environment', with options 'Node.js' and 'More...'. Do you have some additional setup associated with F5? |
@andycraig yes, sorry I forgot about this:
|
@bersbersbers Thank you! I have a suspicion that this might be related to using a remote session. I will look into it. If you experience this error again, could you post here with the names of all the terminals that were open at the time? (E.g., '1: R Interactive', '2: bash' etc.) That will help with investigating the problem. Thanks in advance! |
Will do! It happens less regularly now, but it did happen once yesterday. |
I had a try at duplicating this error using a Docker container and the ‘Remote - Containers’ extension, but I couldn’t get it to happen. (Not quite the same as SSH, but I had thought that just using a remote might be the problem.) The error ‘Error identifying terminal! This shouldn't happen, so please file an issue at https://github.com/Ikuyadeu/vscode-R/issues’ should only happen if the active terminal is undefined, and there is not exactly one terminal. I think it must take a very particular set of circumstances for VS Code to get into that state. Other information that would be useful for investigating this:
Thank you! |
Alright, here we go. I just killed a long-running R script with the trash-can symbol, and then tried to restart it with F5. That's when I got the error again. Let's try to investigate further.
|
Thank you for providing this update - this information is very helpful. This is definitely a case where every bit helps! I’ll do some more investigating. |
@bersbersbers Thank you again for posting that GIF. There is something very weird going on. I was thinking that I could remove and rearrange some code to handle all situations but I've realised that still not quite the case. My new plan is to make it more robust where I can, which might avoid the error sometimes. In the case shown in your GIF, I'd like to make it output a bunch of debugging information so we can get a better sense of the internal state of VS Code when it happens. Then we might have a better sense of what's going on, and possibly some more information to pass on to the VS Code team - at this point I'm not sure if the problem is this extension, VS Code itself, or both. Sorry about having to put up with this error for so long! Thank you for bearing with me. |
Welcome!
Sounds good, I'll be happy to pass on any debug output.
No worries, it happens only several times a week and I can usually fix it by activating the terminal with a single click. That's the main reason for my slow responses to your requests ;) |
Good to hear it can usually be fixed with a click at least! I think there is actually a bug in VS Code relating to |
Ah, great, you're now able to reproduce this. That's good, as you won't be blocked on my further repros ;) good luck! |
Hi @bersbersbers, sorry for the lack of action on this. I believe the root cause is the bug in VS Code, but even with that bug there is a workaround in vscode-R that should be handling it gracefully without error. The error is happening, though, so I think there may be a second problem. I can reproduce the VS Code bug but unfortunately not the vscode-R error. The latest version of vscode-R outputs more information when this error occurs. The error message now asks the user to run the command 'Developer: Toggle Developer Tools' and check the console for a diagnostic message. The screenshot below shows what it should look like after running 'Developer: Toggle Developer Tools'. If you get this error again, if you could copy the section of the console starting with '[chooseTerminal]' and paste it here, that will help with debugging this problem. (I made the screenshot artificially by moving some code around since I haven't managed to reproduce the error myself.) Thank you again for your patience on this. |
Thank you! I haven't met the bug in a while, but this is mostly due to me trying out https://marketplace.visualstudio.com/items?itemName=RDebugger.r-debugger as well. I think your instructions are well-suited for users (me or anyone else) to gather the required information. |
The VS Code bug ( |
This issue is stale because it has been open for 365 days with no activity. |
This issue was closed because it has been inactive for 14 days since being marked as stale. |
Describe the bug
Do you want to fix by self? (I hope your help!)
No, but I can help debug.
Environment (please complete the following information):
The text was updated successfully, but these errors were encountered: