HNHacker News
TopNewBestAskShowJobs

piekvorst

164 karma · joined September 26, 2025

blog: piekvorst.github.io

email: piekvorst@outlook.com

submissionscomments
piekvorst··on Make macOS consistently bad unironically
I never have any window in the fullscreen/maximized mode. Some are pretty large, such as IDE, and they sometimes touch one or more edges of the screen/dock/panel, but never occupy the entire space. That was true even on my 14in MacBook with 125% DPI.

That said, I am a huge fan of manual window management.

piekvorst··on Shell Tricks That Make Life Easier (and Save Your Sanity)
I think modern terminal emulators and readline-based shells support it.

This is not to say that there's nothing to improve. Multiline editing experience suffers, and non-readline shells aren't supported. Those problems were solved by Plan 9 (at the cost of dropping xterm compatibility), but the mainstream hasn't yet adopted those solutions.

piekvorst··on Shell Tricks That Make Life Easier (and Save Your Sanity)
Indeed, @b[] is for bold, and @t[] is for something else. The joke falls apart, and somehow a piece of my identity goes with it. But thanks for clarifying.
piekvorst··on Shell Tricks That Make Life Easier (and Save Your Sanity)
I can't reproduce the glob expansion problem.

    % echo test >'/tmp/hello world'
    % cat /tmp/hello*
    test
This is bash 5.3.9.

Still, I couldn't agree more on limiting IFS. Personally, I set it only to <LF>.

In my scripts, I rely on the $(ls) idiom heavily. People I've talked to consider this an anti-pattern and suggest relying on -0, -z, --zero, --null, and -print0 flags instead. I don't deny that it's better than nothing when correctness is the goal, but I’d counter that shell is more about using a familiar interface (text representation) to solve new tasks, not about writing correct code (that’s the domain of other languages). An uncritical pursuit of correctness often results in convoluted code.

(I know that $(ls) is a subject to various expansions. I solve this problem by using a shell that doesn't do that [1].)

Another consideration is that /bin/ls and /bin/find are not the only sources of filenames. Sometimes the source is third-party or has to be user-friendly (and thus separated by traditional newlines).

Some typographical issues just can't be solved by a pursuit of mechanistic correctness. For another example, the \.txt$ idiom wouldn't work if spaces are allowed at the end of filenames. Those problems are not even shell-specific.

Those are just a few of my personal notes. Fortunately, there's a more systematic and comprehensive study of this issue [2].

[1]: https://9p.io/sys/doc/rc.html

[2]: https://dwheeler.com/essays/fixing-unix-linux-filenames.html

piekvorst··on Shell Tricks That Make Life Easier (and Save Your Sanity)
Even without tab completion, the variable can hold unexpected values due to user error (you don't see the command as a whole), multiple shell windows, or forgotten context.

Relying on it even in limited scenarios can train an invisible habit that would backfire at the least expected moment.

Any assistance intended for immediate action should itself be immediate, not indirect.

piekvorst··on Shell Tricks That Make Life Easier (and Save Your Sanity)
This reminds me of an excerpt from an old Emacs manual:

    . . . if you forget which commands deal with windows, just type @b[ESC-?]@t[window]@b[ESC].
This weird command is presented with such a benevolent innocence as if it's the simplest thing in the world.

I think the better advice for command-line editing would be to set up the mouse.

piekvorst··on Shell Tricks That Make Life Easier (and Save Your Sanity)
Is it just me, or is it an LLM language? The article tries very hard to be correct but somehow lacks experience.

I've never used the majority of these tricks for decades, except for brace expansion, process substitutions, and complex redirections.

piekvorst··on Shell Tricks That Make Life Easier (and Save Your Sanity)
The '-' shortcut is weird. In 'git commit -F -', the '-' is actually /dev/stdin.
piekvorst··on Sed, a powerfull mini-language from the 70s
vi and sed took the s/ syntax from ed, independently of each other.
piekvorst··on Sed, a powerfull mini-language from the 70s
Yeah, sam is not universal, but it can solve complex tasks more simply by just running it a few times. The final example already normalizes \n (v/./ c/\n/) in a single pass, but we can make it even simpler by just writing:

    , x/(.+\n)+/ .,+#0-#1 x/\n/ c/ /
    , x/\n+/ c/\n/
(I haven’t tested it.)

I’m glad that sam worked out for you. You can learn more from [1] and [2]. If you need any help, you’re always welcome to ask me.

[1]: https://ratfactor.com/papers/sam_tut.pdf

[2]: https://9p.io/sources/contrib/steve/other-docs/struct-regex....

piekvorst··on Sed, a powerfull mini-language from the 70s
Yes, sam can be used on the command line with ssam [1]. It's specific to plan9port [2]. In the original Plan 9, ssam wasn't included because Rob Pike didn't want to give up the X command that handles multiple files [3]:

    I find the X command extremely powerful, and can't see any way to
    have a streaming implementation that will look at multiple files
    simultaneously.
> Is there a port to Apple silicon?

plan9port works on it. It compiled without any errors on my Apple Silicon Mac.

[1]: https://9fans.github.io/plan9port/man/man1/ssam.html

[2]: https://9fans.github.io/plan9port

[3]: https://9fans.topicbox.com/groups/9fans/Tdf6095a105816f01-M3...

piekvorst··on Sed, a powerfull mini-language from the 70s
That's exactly right. A few unmentioned details:

. The dot (".") never matches newlines, which keeps line-oriented idioms from accidentally spanning newlines [1]

. Changes must be sequential and non-overlapping (that's why I deleted the whole thing before processing in the third example).

. Sam matches only the original input, not past changes.

. Addresses (expressions before commands) select a single range, x commands select multiple ranges and loop over it.

[1]: https://p9f.org/sys/doc/sam/sam.html, Regular expressions

piekvorst··on Sed, a powerfull mini-language from the 70s
I prefer sam [1]. Unlike sed, it's not Turing complete, but it is far more elegant to my taste - consider this example from the article:

    :loop N; s/\n[[:space:]]\+/ /g; t loop; p
In sam, the equivalent is:

    x/(.+\n)*/ x/\n */ c/ /
It reads like this: loop over paragraphs of non-empty lines, loop over newline followed by spaces, replace with a single space. It's surprisingly close to SQL in its eloquence.

Another example:

    N; h; s/\n/->/g ;p; g; D
In sam, an equivalent would be

    {
        1,$-2 x/./ {
            a/->/
            /./ t .
        }
        $-1 d
    }
Again, it's readable from top to bottom: from the first line to the second from the end, loop over each symbol, put "->" after it and copy the next symbol next to it; delete the last line.

Let's see how far we can get. Another example:

    N; h; s/\n/->/g; p; G; D
In sam, an equivalent would be:

    {
        d
        1,$-2 x/./ {
            1,/./ x/.|\n/ {
                g/./ t $
                g/\n/ $ c/->/
            }
            $ c/\n/
        }
    }
It reads like this: delete the whole thing; from the first line to the second from the end, loop over each character; on each iteration, from the first line to the next character, run an inner loop over each character or newline; if it's a character, put it at the end; otherwise, put "->" at the end; once the inner loop is done, put a newline at the end.

The final example from the post is too long to have it here (15 lines). Here's just the sam equivalent for it:

    x/(.+\n)+|\n+/ {
        g/./ x/\n/ c/ /
        v/./ c/\n/
    }
It reads like this: loop over paragraphs of non-empty lines or sequences of newline characters; if it has any symbol (that is, it's a paragraph), replace each newline symbol with a space; if it doesn't have a symbol (that is, it's a sequence of newline symbols), replace it with a single newline.

What I have learned from this is that a tool with limited but well-chosen primitives is more convenient than a universal state machine.

(My examples may not be the exact same algorithms, since I do not understand (or need) sed concepts, but they do produce the same output.)

[1]: https://9p.io/sys/doc/sam/sam.html

piekvorst··on Plan 9's Acme: The Un-Terminal and Text-Based GUIs
The main difference between Acme and TUI is that Acme is just pure plain text and single cursor, whereas TUI, essentially, emulate terminal hardware of the past. In this respect, TUI is closer to HTML than to plain text.
piekvorst··on “ma” is a minimalistic clone of the acme editor used in Plan 9
I use Rio, Acme, and occasionally Sam from plan9port [1].

The only major problems are X.org dependency, lack of mouse warping in XWayland (essential for Acme), and slow text rendering on Raspberry Pi 5.

[1]: https://9fans.github.io/plan9port/

piekvorst··on Bill C-22, the Lawful Access Act: Dangerous backdoor surveillance risks remain
Any president can go insane and go against the country’s principles. Nobody is perfectly safe from that. The issue with the constitution and declaration is intellectual: it takes centuries to completely override them. And when the president does go insane, you have the whole intellectual apparatus working against him. It is something, not just a nonexistent “remedy.”
piekvorst··on //go:fix inline and the source-level inliner
I think the core reasoning is about minimizing its use. I have answered [1] the same question in another thread.

https://news.ycombinator.com/item?id=47395574

piekvorst··on //go:fix inline and the source-level inliner
I suppose, to minimize its use. If annotations have the same syntactic weight as normal statements, such as “if” or “for” statements, there’s a temptation to use them liberally, which is clearly not a good fit for Go.

By making them comments, Go subtly signals that these are exceptional, making them less prominent and harder to abuse.

piekvorst··on Your phone is an entire computer
> As a US citizen, I must go through the Apple-approved App Store to download / install third-party software. Smells like freedom.

If you’re a U.S. citizen, it’s worth studying what this country’s foundational freedom means specifically, why and why not something else, such as consumer rights.

piekvorst··on Hyperlinks in terminal emulators
Isn't VT220 meant to be extensible? Just the hardware stopped at a certain point.
piekvorst··on Hyperlinks in terminal emulators
Not sure about popularity but Plan 9 has had this for decades, thanks to Plumber [1].

[1]: https://p9f.org/sys/doc/plumb.html

piekvorst··on Hyperlinks in terminal emulators
This is a basic copy-paste and search function. I admit that your approach is fast but counter that it highlights a failure to make basic functions like copy-paste and search efficient and introduces a whole class of complexity into software design.

Edit: the same applies to diffs generated by /bin/diff. Most of the time, diff strings are unique enough to locate them by plain text searching.

piekvorst··on Hyperlinks in terminal emulators
So, the approach is identical to <a href="example.com">example</a>.

In contrast, in Plumber [1], we have things like !98—this text opens pull request no. 98 by passing "!98" to the local server, which knows how to interpret it.

Both approaches go one step beyond plain text. However, Plumber’s approach, at least, doesn’t compromise the plain text itself by embedding invisible elements.

This eliminates an entire category of risks by design. With no hidden metadata, accidental clicks are less probable and social engineering attacks, such as UI deception, are impossible.

[1]: https://p9f.org/sys/doc/plumb.html

piekvorst··on Writing my own text editor, and daily-driving it
Acme [1]

It steps back from the “customize everything” mantra, believing that approach leaves users with an underdeveloped essential system. But it still has two major APIs: one for window manipulation [2], the other for text-based integration with the surrounding system via plumber [3].

All textual CLI tools (that is, those without pseudographics) work by default and are the heart of its style.

I use Acme for everything except web browsing (although most links are still managed by Acme).

[1]: http://youtu.be/dP1xVpMPn8M

[2]: http://9p.io/magic/man2html/4/acme

[3]: http://9p.io/sys/doc/plumb.html

piekvorst··on Yoghurt delivery women combatting loneliness in Japan
> The thinking child is not antisocial (he is, in fact, the only type of child fit for social relationships). When he develops his first values and conscious convictions, particularly as he approaches adolescence, he feels an intense desire to share them with a friend who would understand him; if frustrated, he feels an acute sense of loneliness. (Loneliness is specifically the experience of this type of child—or adult; it is the experience of those who have something to offer. The emotion that drives conformists to "belong," is not loneliness, but fear—the fear of intellectual independence and responsibility. The thinking child seeks equals; the conformist seeks protectors.)

https://aynrandlexicon.com/lexicon/loneliness.html

piekvorst··on LibreSprite – open-source pixel art editor
I speak two languages (English and Russian) and have never found their name to be awkward. This is the first time, actually, that I've seen somebody say they don't like their name.
piekvorst··on Zed new terms required to be 18 years old
/bin/ed wouldn't ask your age. It would simply deduce it.
piekvorst··on Was Windows 1.0's lack of overlapping windows a legal or a technical matter?
The primary value of overlapping windows is spacial memory: you remember where a given window is positioned on a 2D surface. The moment I grasped this I had the “oh boy I sure am glad this window partially overlaps this other window.”

(At one moment, I used to work on a single desktop with around 20 windows, no dock, just windows, on my 14in MacBook with 125% DPI. Too much but possible. Now I keep only 6-7 windows.)

This is not to say that dynamic window management is worse. Far from it. But it excels at this: dynamic, rapidly changing environments, where at almost any given moment something is either opening, closing, or changing its dimensions. This is usually the case with specialized programs like web browsers or IDE, but not with the main system WM.

The main problem is that overlapping windows and automatic window management are incompatible. The former assumes that user sets the dimensions and is always right, which makes the latter powerless to follow any efficient algorithm. To give an example, if you manage your windows with a dock and “maximize” button, they’d break overlapping patterns.

> I either want one full screen windows or a few windows side by side.

You’re not wrong to work like this, but it may be a byproduct of modern hybrid systems making it harder to fully internalize the overlapping windows concept.

piekvorst··on Textadept
We would need it when this era ends.

/s

piekvorst··on New iPad Air, powered by M4
Now you can bring the power and convenience of your laptop to iPad with just a single VNC connection. Oh wait…
← PreviousPage 3 of 6Next →