Blank, unresponsive terminal pane

@GaryR I am having the same problem reported on RStudio Community here and here and GitHub issue 2817 - the terminal window is blank and unresponsive.

I am on Windows 10 and R 3.6.2. I originally saw the issue with the latest released RStudio 1.2. Upgraded to Version 1.3.842. Now the problem presents this way:

When I open a new terminal I get this error:
image

The terminal window has a cursor but no prompt. If I type Enter I just get an error:
Error: The specified module could not be found

Terminal Diagnostics shows

Global Terminal Information
---------------------------
Loaded TerminalSessions: 1
Handle: '314F8F42' Caption: 'Terminal 1'

Terminal List Count: 1
Handle: '314F8F42' Caption: 'Terminal 1' Session Created: true

Current Terminal Session Information
------------------------------------
Caption:     'Terminal 1'
Title:       ''
Cols x Rows  '119 x 26'
Shell:       'Command Prompt'
Handle:      '314F8F42'
Sequence:    '1'
Restarted:   'true
Busy:        'true'
Exit Code:   'null'
Full screen: 'client=false/server=false'
Zombie:      'false'
Track Env    'false'
Local-echo:  'false'
Working Dir: 'Default'
Interactive: 'Always'
WebSockets:  'true'

Current Terminal Emulator Settings
------------------------------------
bellStyle: sound
cursorStyle: block
fontFamily: "Lucida Console", monospace
fontWeight: normal
fontWeightBold: bold
rendererType: canvas
allowTransparency: false
cancelEvents: false
convertEol: false
cursorBlink: true
disableStdin: false
drawBoldTextInBrightColors: true
macOptionClickForcesSelection: false
macOptionIsMeta: false
rightClickSelectsWord: false
screenReaderMode: false
windowsMode: true
fontSize: 13
letterSpacing: 0
lineHeight: 1
tabStopWidth: 8
scrollback: 1000

System Information
------------------
Desktop:    'true'
Remote:     'false'
Platform:   'Windows'

Connection Information
----------------------
2020/2/26 9:04:40: Connect WebSocket: 'ws://127.0.0.1:5402/terminal/314F8F42/'
2020/2/26 9:04:40: WebSocket connected
2020/2/26 9:04:40: Disconnected
2020/2/26 9:04:40: WebSocket closed

Local-echo Match Failures
-------------------------
<Not applicable>

In the Request Log there is a start_terminal request with this data:

Request ID: -73640144

== REQUEST ======
{
  "method": "start_terminal",
  "params": [
    {
      "handle": "2681F19F",
      "caption": "Terminal 1",
      "show_on_output": false,
      "interaction_mode": 2,
      "max_output_lines": 1000,
      "buffered_output": "\n",
      "exit_code": null,
      "terminal_sequence": 1,
      "allow_restart": true,
      "title": "",
      "child_procs": false,
      "shell_type": "win-cmd",
      "channel_mode": 1,
      "channel_id": "6692",
      "alt_buffer": false,
      "cwd": "",
      "cols": 80,
      "rows": 25,
      "restarted": false,
      "autoclose": 0,
      "zombie": false,
      "track_env": false
    }
  ],
  "clientId": "33e600bb-c1b1-46bf-b562-ab5cba070b0e",
  "clientVersion": ""
}

== RESPONSE ======
{
  "result": {
    "handle": "2681F19F",
    "caption": "Terminal 1",
    "show_on_output": false,
    "interaction_mode": 2,
    "max_output_lines": 1000,
    "buffered_output": "\n",
    "exit_code": null,
    "terminal_sequence": 1,
    "allow_restart": true,
    "title": "",
    "child_procs": false,
    "shell_type": "win-cmd",
    "channel_mode": 1,
    "channel_id": "5402",
    "alt_buffer": false,
    "cwd": "",
    "cols": 80,
    "rows": 25,
    "restarted": true,
    "autoclose": 0,
    "zombie": false,
    "track_env": false
  },
  "ep": "false"
}

followed by a process_start with this error:

Request ID: 1818262687

== REQUEST ======
{
  "method": "process_start",
  "params": [
    "2681F19F"
  ],
  "clientId": "33e600bb-c1b1-46bf-b562-ab5cba070b0e",
  "clientVersion": ""
}

== RESPONSE ======
{
  "error": {
    "code": 100,
    "message": "Error occurred while executing method",
    "error": {
      "code": 126,
      "category": "system",
      "message": "The specified module could not be found",
      "location": "class rstudio::core::Error __cdecl rstudio::core::system::WinPty::startPty(void **,void **,void **) src/cpp/core/system/Win32Pty.cpp:423"
    }
  }
}

Let me know if there is any additional information that would help.
Thanks, Kent

I noticed that websockets was set to true; I had a problem when connected to my corporate rstudio server specific to firefox browser where I needed to disable websocket to get normal terminal functionality. Whereas chrome was fine either way. Not sure if thats helpful, but its one more thing to try and see if it makes a difference.

I'm using RStudio Desktop so it is not running in a browser. Is there a way to turn off WebSockets in RStudio Desktop?

I found that there is a button for that even on desktop:
image

Thanks, I tried turning off WebSockets; it doesn't make any difference.

Sorry, don't give up !

This is a missing DLL. I've yet to determine what causes the DLL to go missing, or more importantly, what DLL it is. It's not related to websockets.

Most likely happening either via a software uninstall and/or a Windows-update. Was terminal working for you originally on this computer, then stopped working, or has it never worked?

Can you try this? Open a command-prompt, then:

cd "\Program Files\RStudio\bin"
winpty-agent --version

What does that show?

Terminal has been working for a long time, it just stopped working. The only change I know of on my computer was to have Malwarebytes installed and removing Trend Micro anti-virus.

winpty-agent --version
winpty version 0.4.3
commit 3e1ab962d5262dd76159870c6dc0724927ca6a9d

I'm trying to get my sysadmin to temporarily disable Malwarebytes to see if that is the problem.

1 Like

Ok, that would be good information. I tried the free version of Malwarebytes, but it doesn't do real-time monitoring and I didn't encounter any problems running the terminal while it was doing a scan.

Also, can you show me results of:

dir "c:\program files\rstudio\bin\winpty.dll"

> dir "c:\program files\rstudio\bin\winpty.dll"

 Volume in drive C is unlabeled      Serial number is xxxx
 Directory of  C:\program files\rstudio\bin\winpty.dll

 5/16/2017  18:53         852,480  winpty.dll
           852,480 bytes in 1 file and 0 dirs    856,064 bytes allocated
   xxxx bytes free

Thanks. OK, that looks correct, so I'll need to keep digging.

I might want to send you a private build of RStudio with some additional diagnostics added to try and nail down what's going on.

Terminal has started working again!? I don't know why. My sysadmin was looking at Malwarebytes, I'll let you know if he did anything.

Well... that's good? Though I'd really like to find out the root cause; let me know if you find out anything about Malwarebytes!

Yes, I would like to know also. I'll keep you posted if I find out anything else (or if it stops working again...)

One other nugget of data - when Terminal was not working, sometimes RStudio would show it as busy in the terminal drop-down and with an alert when I quit.

Hello kent37, have you been able to determined further the root cause of this issue? I have had this problem for a week now. I too tried to fix the problem by reinstalling R and Rstudio. You help will be greatly appreciated.

No, the issue has not recurred for me and I don't have any additional information.

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.