rogalmic / vscode-bash-debug

Bash shell debugger extension for VSCode (based on bashdb)
MIT License
217 stars 26 forks source link

Spaces in fil/folder names give issues #65

Closed beruic closed 6 years ago

beruic commented 6 years ago

In addition to the details for issue, please provide us Executables information and Debug output unless you have confidence that they don't help us.

Executables

Output of bash -c 'uname -a; for P in bash bashdb cat mkfifo pkill code; do echo ---; which -a $P; command $P --version; done:

Linux jk-dev 4.13.0-38-generic #43~16.04.1-Ubuntu SMP Wed Mar 14 17:48:43 UTC 2018 x86_64 x86_64 x86_64 GNU/Linux
---
/bin/bash
GNU bash, version 4.3.48(1)-release (x86_64-pc-linux-gnu)
Copyright (C) 2013 Free Software Foundation, Inc.
Licens GPLv3+: GNU GPL version 3 eller senere <http://gnu.org/licenses/gpl.html>

This is free software; you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
---
/usr/bin/bashdb
bashdb, release 4.3-0.91
---
/bin/cat
cat (GNU coreutils) 8.25
Copyright © 2016 Free Software Foundation, Inc.
Licens GPLv3+: GNU GPL version 3 eller nyere <http://gnu.org/licenses/gpl.html>.
Dette er frit programmel: du kan frit ændre og videredistribuere det.
Der gives INGEN GARANTI, i den grad som loven tillader dette.

Skrevet af Torbjørn Granlund (Torbjörn Granlund) og Richard M. Stallman.
---
/usr/bin/mkfifo
mkfifo (GNU coreutils) 8.25
Copyright © 2016 Free Software Foundation, Inc.
Licens GPLv3+: GNU GPL version 3 eller nyere <http://gnu.org/licenses/gpl.html>.
Dette er frit programmel: du kan frit ændre og videredistribuere det.
Der gives INGEN GARANTI, i den grad som loven tillader dette.

Skrevet af David MacKenzie.
---
/usr/bin/pkill
pkill from procps-ng 3.3.10
---
/usr/bin/code
1.22.1
950b8b0d37a9b7061b6f0d291837ccc4015f5ecd
x64

Debug output

14:50:10, 2018-4-11
From client: initialize({"clientID":"vscode","clientName":"Visual Studio Code","adapterID":"bashdb","pathFormat":"path","linesStartAt1":true,"columnsStartAt1":true,"supportsVariableType":true,"supportsVariablePaging":true,"supportsRunInTerminalRequest":true})
To client: {"seq":0,"type":"response","request_seq":1,"command":"initialize","success":true,"body":{"supportsConditionalBreakpoints":false,"supportsConfigurationDoneRequest":false,"supportsEvaluateForHovers":true,"supportsStepBack":false,"supportsSetVariable":false}}
From client: launch({"type":"bashdb","request":"launch","name":"Bash-Debug (select script from list of sh files)","cwd":"/home/jk/Arkivering_Frederikshavn/zip - Zip Archive","program":"/home/jk/Arkivering_Frederikshavn/zip - Zip Archive/sort_zips.sh","args":[],"showDebugOutput":true,"trace":true,"pathBash":"bash","pathBashdb":"bashdb","pathCat":"cat","pathMkfifo":"mkfifo","pathPkill":"pkill","__sessionId":"c9c0fb46-948d-4df2-bbf3-462bc6c3d890"})
To client: {"seq":0,"type":"response","request_seq":2,"command":"launch","success":false,"message":"Error: cwd (/home/jk/Arkivering_Frederikshavn/zip - Zip Archive) does not exist."}
From client: disconnect({"restart":false})
To client: {"seq":0,"type":"response","request_seq":3,"command":"disconnect","success":false,"message":"TypeError: Cannot read property 'on' of undefined\n    at BashDebugSession.disconnectRequest (/home/jk/.vscode/extensions/rogalmic.bash-debug-0.1.1/out/bashDebug.js:35:29)\n    at BashDebugSession.dispatchRequest (/home/jk/.vscode/extensions/rogalmic.bash-debug-0.1.1/node_modules/vscode-debugadapter/lib/debugSession.js:347:22)\n    at BashDebugSession.dispatchRequest (/home/jk/.vscode/extensions/rogalmic.bash-debug-0.1.1/node_modules/vscode-debugadapter/lib/loggingDebugSession.js:48:15)\n    at BashDebugSession._handleData (/home/jk/.vscode/extensions/rogalmic.bash-debug-0.1.1/node_modules/vscode-debugadapter/lib/protocol.js:97:38)\n    at Socket.inStream.on (/home/jk/.vscode/extensions/rogalmic.bash-debug-0.1.1/node_modules/vscode-debugadapter/lib/protocol.js:18:44)\n    at emitOne (events.js:96:13)\n    at Socket.emit (events.js:191:7)\n    at readableAddChunk (_stream_readable.js:178:18)\n    at Socket.Readable.push (_stream_readable.js:136:10)\n    at Pipe.onread (net.js:560:20)","body":{"error":{"id":1104,"format":"{_stack}","variables":{"_exception":"Cannot read property 'on' of undefined","_stack":"TypeError: Cannot read property 'on' of undefined\n    at BashDebugSession.disconnectRequest (/home/jk/.vscode/extensions/rogalmic.bash-debug-0.1.1/out/bashDebug.js:35:29)\n    at BashDebugSession.dispatchRequest (/home/jk/.vscode/extensions/rogalmic.bash-debug-0.1.1/node_[...]

Details

Details goes here. Whenever I work in a directory where the path contains spaces (in this case the project folder is named zip - Zip Archive) I get the following error message when trying to debug: skaermbillede fra 2018-04-11 14-52-34

rogalmic commented 6 years ago

Awww, snap... Good catch!

Creating a fix in PR https://github.com/rogalmic/vscode-bash-debug/pull/66

beruic commented 6 years ago

Cool. Any expectations to when it will release?

rogalmic commented 6 years ago

If you help with testing, then soon :).

bash-debug-0.1.1.vsix.zip

image

beruic commented 6 years ago

Will look at it tomorrow (CET) :)

beruic commented 6 years ago

I can confirm that the fix works. I can debug again :)

rogalmic commented 6 years ago

OK, thank you for your feedback.