Skip to content

fix: echo -e should not print "-e" #510

@nfischer

Description

@nfischer

Node version (or tell us if you're using electron or some other framework):

any

ShellJS version (the most recent version/Github branch you see the bug on):

master

Operating system:

any

Description of the bug:

In bash, echo -e just means to interpret backslashes specially (i.e. '\n' is a newline, instead of a literal '\n'). This is the default behavior for ShellJS echo() (since that's how console.log() works), so we should document it. Also, we should allow the -e option, and just make it a no-op.

Example ShellJS command to reproduce the error:

> echo('-e', 'Any message'); // This should not print '-e'
-e Any message
> echo('Any message'); // The previous command should do the same thing as this command
Any message

Metadata

Metadata

Assignees

Labels

docsfeaturefixBug/defect, or a fix for such a problem

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions