SchoofsKelvin / vscode-sshfs

Extension for Visual Studio Code: File system provider using SSH
GNU General Public License v3.0
543 stars 36 forks source link

Remote Commands when /tmp/.Kelvin_sshfs already exists from another user #301

Closed SpanishPear closed 2 years ago

SpanishPear commented 2 years ago

When the /tmp/.Kelvin_sshfs file already exists (by another user) - the extension leads to error.

Would it be possible to put either the .Kelvin_sshfs file required for REMOTE_COMMANDS in ~ - or make the location configurable? I'm also unable to execute the currently existing file, as it is owned by another user and not world executable.

Relevant Logs:

[INFO]    [createConnection(cses,config)] Flag REMOTE_COMMANDS provided in 'Global Settings', setting up command terminal
[INFO]    [CmdTerm(cses)] Got TTY path: `tty`[?12l[?25h
[ERROR]   [createConnection(cses,config)] Failed to write profile script to /tmp/.Kelvin_sshfs:
Error: Permission denied
JSON: {"code":3,"lang":""}
Error: Permission denied
    at k._transform (/home/shrey/.vscode/extensions/kelvin.vscode-sshfs-1.23.1/dist/14f8.extension.js:1:82647)
    at k.Transform._read (internal/streams/transform.js:205:10)
    at k._read (/home/shrey/.vscode/extensions/kelvin.vscode-sshfs-1.23.1/dist/14f8.extension.js:1:78652)
    at k.Transform._write (internal/streams/transform.js:193:12)
    at writeOrBuffer (internal/streams/writable.js:358:12)
    at k.Writable.write (internal/streams/writable.js:303:10)
    at l.ondata (internal/streams/readable.js:719:22)
    at l.emit (events.js:315:20)
    at addChunk (internal/streams/readable.js:309:12)
    at readableAddChunk (internal/streams/readable.js:284:9)
Caused by toPromise:
    at l._createConnection (/home/shrey/.vscode/extensions/kelvin.vscode-sshfs-1.23.1/dist/extension.js:11:14505)
    at processTicksAndRejections (internal/process/task_queues.js:93:5)
Disabling REMOTE_COMMANDS flag
Logged at:
    at /home/shrey/.vscode/extensions/kelvin.vscode-sshfs-1.23.1/dist/extension.js:11:15530
    at processTicksAndRejections (internal/process/task_queues.js:93:5)
    at async l._createConnection (/home/shrey/.vscode/extensions/kelvin.vscode-sshfs-1.23.1/dist/extension.js:11:14492)
Reported by logger createConnection(cses,config)
[DEBUG]   [createConnection(cses,config)] Environment: [
    {
        "key": "KELVIN_SSHFS_CMD_PATH",
        "value": "\u001b[35m`\u001b[39m\u001b[32mtty\u001b[39m\u001b[35m`\u001b[39m\u001b[K\u001b[?12l\u001b[?25h"
    }
]
SchoofsKelvin commented 2 years ago

The profile file is already made unique per user (see #292, builds available here starting from build 83), the fix didn't make into a released version yet.

What shell are you using? It seems like you're using something that doesn't support backtick command substitution (such as fish) which would prevent REMOTE_COMMANDS from working even without the shared file issue. I am currently working on supporting more (and hopefully basically all common) shells, including fish, which isn't a small effort and might still take a bit.

SpanishPear commented 2 years ago

Ah, I'm using the 1.23.1, and the zsh shell.

If this is already unique per user in the next release, happy to close this issue - thank you!

SchoofsKelvin commented 2 years ago

Released in v1.24.0 of the extension.