-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
ls: Unexpected space before stdout in TTY output #6386
Comments
Well maybe it is not exactly a space. scene
.ucmd()
.arg("--hide-control-chars")
.arg("one\ntwo")
.terminal_simulation(true)
.succeeds()
.stdout_only(" 'one'$'\\n''two'\n"); and this still fails, but the diff message is broken:
I'll investigate more to find what is this character and try to find where it comes from. |
I modified the assertion code to dump the bytes of expected/got stdouts on failure, and I ended up with this:
So it appears that the prefix character is indeed a I still don't have a clue for why is this happening though. EDIT:I keep finding things ! For reference:
Now what's left is to actually understand WHY a space is inserted here. |
Found: this is where the space is added. No searching why is the behavior only triggered by TTY |
I removed the "adding space if quoted and starts with I am not sure what it is made for, but so far, removing it fixes my problem. @tertsdiepraam I see you changed this code in |
For anyone else, link to that commit: 3346b41 Seems like I made a mistake? The logic should be that there's a space if the quoting style does not add a quote, but I seem to have flipped that behaviour? That's not good :) Negating the condition should fix it. But, we also need to think about when it's quoted with |
I can, but I don't have all the context. I don't know in what case a space is required in the first place. |
It's just an alignment thing. Here's an example using GNU:
Note how all the files have a space to compensate for not having quotes and that |
Oh, I think I get it. I'll give it a try ! |
I was fixing TODOs in the testsuite to check TTY outputs.
And I realized that there is a seemingly unexpected character (presumably a space) that gets printed.
The default escaping strategy when outputing to a TTY is
shell-escape
. Strangely, the bug does not appear when output is not a TTY but with--quoting-style=shell-escape
set, as already checked by the testsuiteThe text was updated successfully, but these errors were encountered: