Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Prompt can't contain [] #648

Closed
codegain opened this issue Feb 24, 2021 · 2 comments
Closed

Prompt can't contain [] #648

codegain opened this issue Feb 24, 2021 · 2 comments
Labels
Bug resolved if issue is resolved, it will be open until merge with master

Comments

@codegain
Copy link

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

@jcubic
Copy link
Owner

jcubic commented Feb 24, 2021

Thanks for the bug report, Will investigate.

@jcubic
Copy link
Owner

jcubic commented Feb 25, 2021

The issue is fixed it will be released in next bug fix version. The problem was that when prompt was not formatting the brackets where not escaped and the whole thing was wrapped in empty formatting, so if fact it was broken formatting. Brackets have special meaning in jQuery Terminal but only if the are in special format (which is know as jQuery Terminal formatting).

@jcubic jcubic added the resolved if issue is resolved, it will be open until merge with master label Feb 25, 2021
@jcubic jcubic closed this as completed Apr 18, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug resolved if issue is resolved, it will be open until merge with master
Projects
None yet
Development

No branches or pull requests

2 participants