Theia: debug: runInTerminal sends unescaped arguments to shell

Created on 3 Dec 2019  路  3Comments  路  Source: eclipse-theia/theia

Description

See https://github.com/eclipse-theia/theia/pull/6508#discussion_r353293561

The Theia code handling runInTerminal requests will try to send arguments to an interactive shell. This breaks down when escaping is needed. The issue seems to come from reusing actual shell processes instead of reusing terminal widgets.

bug debug

Most helpful comment

Example: If I want to execute something like ["node", "-e", "console.log(1 + 2)"] then the current code will just write node -e console.log(1 + 2). If you try to run that in a unix shell it will fail.

All 3 comments

@marechal-p please explain how to reproduce, i.e. share a concrete command or a setup

Example: If I want to execute something like ["node", "-e", "console.log(1 + 2)"] then the current code will just write node -e console.log(1 + 2). If you try to run that in a unix shell it will fail.

After looking into how we can get processes to spawn, not going through a shell means that aliases or programs in the PATH variable won't work. So we are ought to escape commands indeed.

Was this page helpful?
0 / 5 - 0 ratings