Skip to content

Make it possible to select an alternative shell to use. #7837

@0xfk0

Description

@0xfk0

Motivation.

Currently, Goose uses the default shell to allow the model to control the computer. In most cases it is /bin/sh on Unix and cmd.exe on Windows.

There are two problems:

  1. On a Unix, the model can assume that it has a bash as a shell and issue complex commands, which will not work if /bin/sh is actually dash or ash, but not bash. Also, it is possible that the user has a non-standard shell like zsh, etc... This can be confusing for the model.

  2. Especially critical for Windows: cmd.exe is an almost unusable thing. You cannot do anything within it. And model too. Even when the model tries to run PowerShell (and in Windows we have two not fully compatible PowerShell versions...), model should deal with relatively complex rules to escape a wide set of symbols (to avoid special interpretation by cmd.exe). Actually, Windows shell is a total hell. And because of this, many people prefer using Cygwin and similar solutions. The same relates to the model: it has good knowledge of Unix shell, and it is much easier for the model to work within a Unix-like environment than in a Windows environment. Actually, a Windows environment is needed only for things like running the build: this is one-two special commands (which still can be run from cygwin). The native Windows shell (cmd.exe) is extremely inconvenient for both the model and the user.

Proposition

Implement new settings: preferred shell. The default value should be /bin/bash for Unix and cmd.exe for Windows. Users must have the possibility to change shell by specifying a binary executable (full path or only name, if executable available in PATH). The main scenario for Windows is that the user selects bash.exe from Cygwin as the main shell.

This feature cannot be implemented just by running commands as cmd.exe, /c, bash -c "Unix-command" (bash.exe must be started directly), because cmd.exe still interprets at least the following characters: %, ^ and ".

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions