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

runInTerminal request problem in 1.33 (previous VSCode versions ok) #71844

Closed
rogalmic opened this issue Apr 6, 2019 · 5 comments
Closed

runInTerminal request problem in 1.33 (previous VSCode versions ok) #71844

rogalmic opened this issue Apr 6, 2019 · 5 comments
Assignees
Labels
debug Debug viewlet, configurations, breakpoints, adapter issues

Comments

@rogalmic
Copy link

rogalmic commented Apr 6, 2019

Seems that VSCode DebugAdapter's this.runInTerminalRequest(...) does not work properly with newest VSCode version. Works fine on previous versions including 1.32.3

The internal runInTerminal request is beeing called with unspecified terminal, but the actual terminal pane does not appear, though success is beeing reported.

RunInTerminal args and success response below.

{"title":"Bash Debug Console","cwd":".","args":["wsl.exe","bash","-c","cd \"/mnt/d/Users/rogal_000/Documents/src/BashDebugger/testing\"; while [[ ! -p \"/tmp/vscode-bash-debug-fifo-19228\" ]]; do sleep 0.25; done; \"bash\" \"/mnt/d/Users/rogal_000/Documents/src/BashDebugger/vscode-bash-debug/bashdb_dir/bashdb\" --quiet --tty \"/tmp/vscode-bash-debug-fifo-19228\" --tty_in \"/tmp/vscode-bash-debug-fifo-19228_in\" --library \"/mnt/d/Users/rogal_000/Documents/src/BashDebugger/vscode-bash-debug/bashdb_dir\" -- \"/mnt/d/Users/rogal_000/Documents/src/BashDebugger/testing/test.sh\" "]}

{"type":"response","seq":3,"command":"runInTerminal","request_seq":2,"success":true,"body":{}}

However, if terminal kind is provided - it works for me:

{"kind":"integrated","title":"BashDebug","cwd":".","args":["wsl.exe","bash","-c","cd \"/mnt/d/Users/rogal_000/Documents/src/BashDebugger/runinterminal-test\"; while [[ ! -p \"/tmp/vscode-bash-debug-fifo-11609\" ]]; do sleep 0.25; done; \"bash\" \"/mnt/d/Users/rogal_000/Documents/src/BashDebugger/vscode-bash-debug/bashdb_dir/bashdb\" --quiet --tty \"/tmp/vscode-bash-debug-fifo-11609\" --tty_in \"/tmp/vscode-bash-debug-fifo-11609_in\" --library \"/mnt/d/Users/rogal_000/Documents/src/BashDebugger/vscode-bash-debug/bashdb_dir\" -- \"/mnt/d/Users/rogal_000/Documents/src/BashDebugger/runinterminal-test/test.sh\" "]}

{"type":"response","seq":3,"command":"runInTerminal","request_seq":2,"success":true,"body":{"shellProcessId":3440}}

Might be related to integrated terminal changes in 1.33.

My W10 version is 17763.404.

Attaching small project that reproduces the issue (Bash Debug extension needed).
runinterminal-test.zip

@rogalmic
Copy link
Author

rogalmic commented Apr 6, 2019

Some non-ascii characters are not working as well in runInTerminalRequest args:

JSON.stringify(termArgs)
"{"kind":"integrated","title":"Bash Debug Console","cwd":".","args":["wsl.exe","bash","-c","cd \"/mnt/c/Users/Michał/Documents/src/bash-debugger/testing\"; while [[ ! -p \"/tmp/vscode-bash-debug-fifo-15640\" ]]; do sleep 0.25; done; \"bash\" \"/mnt/c/Users/Michał/Documents/src/bash-debugger/vscode-bash-debug/bashdb_dir/bashdb\" --quiet --tty \"/tmp/vscode-bash-debug-fifo-15640\" --tty_in \"/tmp/vscode-bash-debug-fifo-15640_in\" --library \"/mnt/c/Users/Michał/Documents/src/bash-debugger/vscode-bash-debug/bashdb_dir\" -- \"/mnt/c/Users/Michał/Documents/src/bash-debugger/testing/test.2.sh\" \"aaaa   \""]}"

results in:

PS C:\Users\Michał\Documents\src\bash-debugger\testing> cd '.'; & 'wsl.exe' 'bash' '-c' 'cd "/mnt/c/Users/Micha/Documents/src/bash-debugger/testing"; while [[ ! -p "/tmp/vscode-bash-debug-fifo-15640" ]]; do sleep 0.25; done; "bash" "/mnt/c/Users/Micha/Documents/src/bash-debugger/vscode-bash-debug/bashdb_dir/bashdb" --quiet --tty "/tmp/vscode-bash-debug-fifo-15640" --tty_in "/tmp/vscode-bash-debug-fifo-15640_in" --library "/mnt/c/Users/Micha/Documents/src/bash-debugger/vscode-bash-debug/bashdb_dir" -- "/mnt/c/Users/Micha/Documents/src/bash-debugger/testing/test.2.sh" "aaaa   "'
: wiersz 0: cd: /mnt/c/Users/Micha/Documents/src/bash-debugger/testing: Nie ma takiego pliku ani katalogu 
bash: /mnt/c/Users/Micha/Documents/src/bash-debugger/vscode-bash-debug/bashdb_dir/bashdb: Nie ma takiego pliku ani katalogu
PS C:\Users\Michał\Documents\src\bash-debugger\testing>

"Nie ma takiego pliku ani katalogu" == No such directory because "ł" letter disappeared from "/mnt/c/Users/Micha/Docu....".

@weinand weinand added debug Debug viewlet, configurations, breakpoints, adapter issues info-needed Issue requires more information from poster labels Apr 8, 2019
@weinand
Copy link
Contributor

weinand commented Apr 8, 2019

@rogalmic please do not mix problems in one issue. I will only discuss the original issue here.

So my understanding of the original issue is:

  • if no "kind" is specified, the request does not return an error response.
  • if a "kind" is specified the request works.

Is my understanding correct?

@rogalmic
Copy link
Author

rogalmic commented Apr 8, 2019

Yes:

@weinand
Copy link
Contributor

weinand commented Apr 8, 2019

Strictly speaking, there is no problem with VS Code's implementation but with the spec:

  • the DAP spec allows to leave "kind" unspecified but it does not explain what that means.
  • the implementation in VS Code "does nothing" in this case (which is a correct interpretation of the given spec). So it does not have to return an error.
  • If VS Code had assumed in previous versions that a non-specified "kind" means "integrated", then that would be a convenient but lax interpretation of the spec.

@weinand
Copy link
Contributor

weinand commented Apr 8, 2019

I've created a clarification request for the DAP: microsoft/debug-adapter-protocol#43

@weinand weinand closed this as completed Apr 8, 2019
@vscodebot vscodebot bot locked and limited conversation to collaborators May 23, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
debug Debug viewlet, configurations, breakpoints, adapter issues
Projects
None yet
Development

No branches or pull requests

2 participants