Skip to content
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions src/plugins/terminal/www/Executor.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ class Executor {
* executor.stop(uuid);
* });
*/
start(command, onData, alpine = false) {
start(command, onData, alpine = true) {
return new Promise((resolve, reject) => {
let first = true;
exec(
Expand Down Expand Up @@ -172,7 +172,7 @@ class Executor {
* .then(//console.log)
* .catch(console.error);
*/
execute(command, alpine = false) {
execute(command, alpine = true) {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

critical

Changing the default value of alpine to true for the execute method introduces a critical regression. Several functions in Terminal.js rely on execute to run commands on the host system for managing the environment.

For example:

  • install() (line 232) uses it to extract the Alpine tarball. This must happen on the host, before the Alpine environment exists.
  • stopAxs(), isAxsRunning(), backup(), restore(), and uninstall() also execute host-level commands.

These calls will fail with alpine=true. Since the call sites are not updated in this PR to explicitly pass alpine: false, please revert this change for the execute method to avoid breaking core functionality. The change for start() is appropriate as it's used for interactive shells.

Suggested change
execute(command, alpine = true) {
execute(command, alpine = false) {

return new Promise((resolve, reject) => {
exec(resolve, reject, this.ExecutorType, "exec", [command, String(alpine)]);
});
Expand All @@ -198,4 +198,4 @@ class Executor {
const executorInstance = new Executor();
executorInstance.BackgroundExecutor = new Executor(true);

module.exports = executorInstance;
module.exports = executorInstance;