how a stray "j" ruined my evening
16 points by miro
16 points by miro
I am honestly puzzled by how anyone is meant to follow this article. I have read it several times and I still do not understand what the actual issue was. It feels as though the most important and interesting part, the precise cause of the problem, has been left out entirely.
After pasting the link into Firefox, it worked. What is going on? I send them the link and it works now...
So you sent them the same link they had sent you, and it worked for them now? The same link that had not worked earlier for them now worked for them? How is that possible?
but in ANSI newline delimiter is translated as "j"
It does not!? Did you mean ^J (Ctrl + J)? But how does Ctrl + J become j at the end of the link? What took the control code and changed it into j?
I think what's going on is:
"ORIGINAL_URL^J"
jq parameters for a permanent fixThings that are adding to the confusion:
gurk to some other people, but I still get the same complaint, and once I tried in my local browser and re-sent the URL, they can access the second link"Definitely agree that the article is not clear at all, but otoh it talks about a real issue with nonprintable char handling, edge cases, and provides practical JQ information (and the script is nice with demonstrations of; using a password database for URLs of personal services, the {VAR?ERROR_MESSAGE} validation)
TBH, I prefer this article much, much more over the LLM slop.
Thanks for this! I should have done a better job explaining the underlying problem. Idea behind these posts (napkins) is to be very brief though here I shot myself in the foot with a paintball gun.
I store files in a private bucket so when I want to share something I have to generate a presigned url that is around 300 characters long.
Turns out I was copying the link with a \n at the end, which in most cases went unnoticed, but in ANSI newline delimiter is translated as "j", hence the stray jay at the end of each link.
What does "in ANSI" mean in this context?
ANSI newline delimiter
I figure the author means "in ANSI [terminal escape sequences] newline delimiter [\n] is translated as [ESC[J]"? Or ^J maybe. It's unclear what was happening.
Yeah, what was turning the newline into an escape sequence? jq should have been piping ASCII 10 directly into the clipboard, so maybe something involved in pasting the newline mangled it?
Also, there’s a stray j at the end of the gist link at the end of the article.
i have removed the j at the end of the gist - it was my poor attempt at an easter egg I forgot to remove.
It was written on a whim and looking back I should have delved more into the details.
Not clear on what is going on.
Do I have the last point correct?
From the title I was expecting this to be about vim movement keys. If I had a dollar for every time I typed jjjjjkjk in the wrong terminal…