The lack of attention to (or, rather, the complete disregard of) proper capitalization is ridiculous. This is the second post I'm seeing in two days that feature this "style". Quite a disturbing trend, if you ask me.
why is it disturbing it reads fine to me
Everything you ever wanted to know about terminals (2018)
21–30 of 50 posts
Re: Everything you ever wanted to know about terminals (2018)
#22That’s pretty nasty - this article is factually incorrect in probably the worst way: the code will work on author’s computer, but not for other people [0] Not to mention that it is missing “good citizen” features like turning off colors when stdout is not a tty. [0] https://news.ycombinator.com/item?id=18125374
> “good citizen” features like turning off colors when stdout is not a tty. Better solution: do not detect whether your output is a tty or not. Let the user decide they want colors or not by using `--color=always` or `--color=never` or similar. There's few things worse than writing a script and getting different output just because you're no longer running the program interactively.
> $ echo "{}" | jq > {} > $ echo "{}" | jq > out.json > jq - commandline JSON processor [version 1.5-1-a5b5cbe] ... etc ...
Turns out when stdout isn't a tty you _must_ specify a filter (in this case '.')
Re: Everything you ever wanted to know about terminals (2018)
#23> it's good form to have a function called resize() or similar that you run on program start and later when the terminal window is resized. while there is a horrible way to do this with ANSI escapes, it's better to just bite the bullet and learn how to use ioctls and termios.
I wanted to know about the horrible ANSI escape sequences to send that can query the window size. Afaict one has to read from the terminal to get the answer--but these are control sequences that could be inserted into the normal stream--when, where, how?
Re: Everything you ever wanted to know about terminals (2018)
#24Earlier quoted context omitted.
> “good citizen” features like turning off colors when stdout is not a tty. Better solution: do not detect whether your output is a tty or not. Let the user decide they want colors or not by using `--color=always` or `--color=never` or similar. There's few things worse than writing a script and getting different output just because you're no longer running the program interactively.
Gah i got bit by this with 'jq'! > $ echo "{}" | jq > {} > $ echo "{}" | jq > out.json > jq - commandline JSON processor [version 1.5-1-a5b5cbe] ... etc ... Turns out when stdout isn't a tty you _must_ specify a filter (in this case '.')
It happens all the time with anything systemd or networkmanager too
Re: Everything you ever wanted to know about terminals (2018)
#25That’s pretty nasty - this article is factually incorrect in probably the worst way: the code will work on author’s computer, but not for other people [0] Not to mention that it is missing “good citizen” features like turning off colors when stdout is not a tty. [0] https://news.ycombinator.com/item?id=18125374
> “good citizen” features like turning off colors when stdout is not a tty. Better solution: do not detect whether your output is a tty or not. Let the user decide they want colors or not by using `--color=always` or `--color=never` or similar. There's few things worse than writing a script and getting different output just because you're no longer running the program interactively.
grep box file.txt
grep box file.txt | grep -v orange-box
Having --color=always is nice sometimes, but there is a reason grep has "--color=auto" and it is the default. If we write invisible characters to file, this breaks all sorts of tools, so it is much safer and more predictable to not include them.Re: Everything you ever wanted to know about terminals (2018)
#26The lack of attention to (or, rather, the complete disregard of) proper capitalization is ridiculous. This is the second post I'm seeing in two days that feature this "style". Quite a disturbing trend, if you ask me.
What is ridiculous and disturbing about using lowercase letters at the beginning of your sentences? In a world where this trend continues your eye will become used to it and it will no longer be a distracting shock from what your eye is used to.
Re: Everything you ever wanted to know about terminals (2018)
#27Earlier quoted context omitted.
What is ridiculous and disturbing about using lowercase letters at the beginning of your sentences? In a world where this trend continues your eye will become used to it and it will no longer be a distracting shock from what your eye is used to.
If this is your argument supporting this trend, then I'm speechless ...
It's pretty clear she pays mind to grammar and cares about its proper usage more than most.
Re: Everything you ever wanted to know about terminals (2018)
#28Oh man, they left out the part I was hoping to find out more about! > it's good form to have a function called resize() or similar that you run on program start and later when the terminal window is resized. while there is a horrible way to do this with ANSI escapes, it's better to just bite the bullet and learn how to use ioctls and termios. I wanted to know about the horrible ANSI escape sequences to send that can…
To put it simply, you can move the cursor down and to the right. For example, you'd move the cursor 999 lines down, then 999 columns to the right, and then query the cursor's position[2]. You can then read the output through STDOUT and parse it.
I'd recommend anyone who's interested in playing around with ANSI and learning how to write a pure terminal-based program to look into the Kilo text editor[3]. That's where I learnt the above instructions.
[1] https://vt100.net/docs/vt100-ug/chapter3.html
Re: Everything you ever wanted to know about terminals (2018)
#29Earlier quoted context omitted.
> “good citizen” features like turning off colors when stdout is not a tty. Better solution: do not detect whether your output is a tty or not. Let the user decide they want colors or not by using `--color=always` or `--color=never` or similar. There's few things worse than writing a script and getting different output just because you're no longer running the program interactively.
I don't see how this is supposed to work? Let's take "grep" for example -- you want both of these to work, and print color to terminal: grep box file.txt grep box file.txt | grep -v orange-box Having --color=always is nice sometimes, but there is a reason grep has "--color=auto" and it is the default. If we write invisible characters to file, this breaks all sorts of tools, so it is much safer and more predictable to…
grep --color=always orange-box file.txt
But, I don't want to see just orange-box. I want to see orange-box and compare against other cases of box. So I would do: grep --color=always box file.txt | grep --color=always orange-box
Without that --color=always, other cases of box will be drowned out by the noise.And if I wanted to write that out to a file then I would do
grep --color=never orange-box file.txt > matches.txt
Alternatively, I'd add a filter to the file with `ansi2txt` grep --color=always box file.txt | grep --color=always box | ansi2txt > no-color-matches.txtRe: Everything you ever wanted to know about terminals (2018)
#30Earlier quoted context omitted.
If this is your argument supporting this trend, then I'm speechless ...
If the author otherwise (that is, first word capitalization issue aside) writes grammatically better than >99% of other internet writers, I submit that you can grant them this one shred of self-expressive style. Goes pretty well with the terminal user theme, to boot. It's pretty clear she pays mind to grammar and cares about its proper usage more than most.