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

Leading spaces are ignored and multiple spaces are collapsed. #9

Closed
asweigart opened this issue Aug 14, 2019 · 3 comments
Closed

Leading spaces are ignored and multiple spaces are collapsed. #9

asweigart opened this issue Aug 14, 2019 · 3 comments
Labels

Comments

@asweigart
Copy link

By default, it seems that leading spaces are ignored. Each of these lines of code produces the same output:

myTerminal.print('X');
myTerminal.print(' X');
myTerminal.print('  X');

Also, multiple spaces are collapsed into a single space. These produce the same output:

myTerminal.print('A Z');
myTerminal.print('A  Z');
myTerminal.print('A   Z');

I found this on Firefox 68.0.1 on Windows 10.

@asweigart
Copy link
Author

I've found a workaround: Adding style="white-space: pre;" to the div that contains the Terminal object. I'm not sure how to put this into a PR though to make it the default behavior.

@ayesc9000
Copy link

This is most likely modern web browsers at work. Pretty much every modern web browser reformats text so that leading spaces are removed and only one space is between characters.

commanddotcom added a commit that referenced this issue May 10, 2021
@commanddotcom
Copy link
Collaborator

fixed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants