Skip to content

Prompt can't contain [] #648

@codegain

Description

@codegain

Issue summary

Hi,
I'm using 2.22.0 and the following prompt:

prompt: '[foobar /]$ ',

Expected behavior

Prompt is

[foobar /]$ 

Actual behavior

Prompt is

[foobar /$ ]

or after pressing Enter, the entered line switches but the prompt stays the same:

[foobar /]$ 
[foobar /$ ]

Steps to reproduce

Use a prompt with [].

f.e. in the demo:

var term = $('body').terminal(() => {}, {
    'prompt': '[foobar /]$ '
});

Additional info

This worked for me as a workaround in 2.21.0:

prompt: '[foobar /]$ ',

f.e. in the demo:

var term = $('body').terminal(() => {}, {
    'prompt': '[foobar /]$ '
});

But now this adds big span elements after the prompt and after [ and ] if Enter is pressed.

Browser and OS

Chrome 88 on Windows 10

Metadata

Metadata

Assignees

No one assigned

    Labels

    Bugresolvedif issue is resolved, it will be open until merge with master

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions