icecoder/ICEcoder

Suggestion: Option for verbose line break in terminal

raymondsalas opened this issue · 3 comments

Hey @mattpass ,

Fix you did in #967 for the terminal.css word-break works great. However, since line breaks are now automatically added on overflow by css, I am having a hard time differentiating which lines really belong in the same line in the original stdout. So, I added this in terminal-xhr.php:

$output = str_replace(PHP_EOL,PHP_EOL."---new line---".PHP_EOL,$output);

image

You may want to consider adding as an option in the settings? Just my thoughts. Feel free to close if unnecessary.

@raymondsalas Hmmm, what I see in ICEcoder seems the same as my local terminal. The CSS changes added were: white-space: pre-wrap; word-break: break-all. The pre-wrap setting should mean it'll wrap when necessary and on line breaks. break-all should mean it'll break on any character (ie, middle of words).

For a test file, I have the content in a long_short.txt file:

LINE 1 LINE 1 LINE 1 LINE 1 LINE 1 LINE 1 LINE 1 LINE 1 LINE 1 LINE 1 LINE 1 LINE 1 LINE 1 LINE 1 LINE 1 LINE 1 LINE 1 LINE 1 LINE 1 LINE 1 LINE 1 LINE 1 LINE 1 LINE 1 LINE 1 LINE 1 LINE 1 LINE 1 LINE 1 LINE 1 LINE 1 LINE 1 LINE 1 LINE 1 LINE 1 LINE 1 LINE 1 LINE 1 LINE 1 LINE 1 LINE 1 LINE 1 LINE 1 LINE 1 LINE 1 LINE 1 LINE 1 LINE 1 LINE 1 LINE 1 LINE 1 LINE 1 LINE 1 LINE 1 LINE 1 LINE 1 LINE 1 LINE 1 LINE 1 LINE 1
LINE 2
LINE 3

...so there's a long line 1 and then a couple more shorter lines.

I see this in ICEcoder...
image

Which seems to have same behavior as this in my local terminal...
image

If you get different wrapping behavior, could you show a screenshot and if possible provide a demo file so I can hopefully recerate issue also?

Hi @mattpass, wrapping behavior is working as expected and the same with your screenshots (through the fix). So I guess this is more of a feature suggestion than an issue/bug.

As a use case example, let's say I'm using the 'grep' command to search through keywords in my entire project folder, it's kind of harder (for me personally at least) to quickly scan which files include the keyword I'm searching through 'grep'. With the modification, it's kind of easier. Kindly see the screenshot below then imagine the results to be like 10x as many of that in the screenshot.

image

If I apply the proposed modification, It's easier to quickly see the beginning and end of each 'grep' result. Kindly see screenshot below then imagine the results to be like 10x as many again.

image

This might not be for everyone, but it could help those who often use terminal to search for something where line breaks would matter and where each result might yield long texts. So if considered to be implemented, it could also be an option in the settings or a toggle switch somewhere in the terminal screen?

I see, I'll leave it open as a suggestion for the future.