Live data from Hacker News

Show HN: Whetuu – a zero-config cross-shell prompt written in Zig

yamafaktory.github.io

21–30 of 40 posts

Re: Show HN: Whetuu – a zero-config cross-shell prompt written in Zig

#21

I don’t want my prompt to also handle shell history, and especially in such an “opinionated” way. What happens to my actual shell-provided history? Does too much for me. edit: > Both files follow the XDG base directory spec, so neither lives in the install directory. Removing whetuu with rm -rf ~/.whetuu cannot take your history with it. whetuu paths prints both locations. Please stop creating directories in my $HOME…

I do want shell history with folders. I tried a few (Atuin? McFly?) but the performance wasn't good with my massive zsh history (going back several years). Zsh+fzf does a buttery smooth job (no folders though, unfortunately). Other tools start to stutter at scale.

Yeah, I do too. From a shell history tool. Not from a shell prompt.

Re: Show HN: Whetuu – a zero-config cross-shell prompt written in Zig

#22
post #4

This is awesome - *A history picker on the up arrow* *Commands are recorded once they finish, and only when they exited cleanly, so typos never clutter the list.* Where the history is stored? Is it possible to store in single place like user root dir?*

Does that mean you can't go up and fix a typo? If so, that sounds strictly worse than what you get by default from the shell (which is up arrow, ctrl-r and various other methods of history searching, and history substitution or editing to fix errors).

I fixed it - you can go up and edit the last failing one. As soon as another cmd succeeds, it will not longer appear in the list and it's never stored into the tool history.

Re: Show HN: Whetuu – a zero-config cross-shell prompt written in Zig

#23
post #11

> Pronounced FEH-too (/ˈfɛ.tuː/). Stress the first syllable. In Māori wh is an f sound, not a w. The macron in ū makes that vowel long, which is why the ASCII spelling doubles it. oof. deliberate choice?

You're right. Whetuu is actually correct in ASCII. I did study study some Te reo Māori a while ago. Will fix.

Fixed :)

Re: Show HN: Whetuu – a zero-config cross-shell prompt written in Zig

#24

Earlier quoted context omitted.

we are not talking about the same thing. I'm talking about ~/.whetuu - the tool doesn't hijack the shell history at all. You can rm -rf the store and your shell history is intact.

The XDG spec tells you exactly where to place your files. It isn’t in $HOME/.your-project ever. You know about XDG enough to mention in your docs, so you should know. It does hijacks shell history. If I press the up arrow, I expect _my shell_ to handle it how I configured it, not your tool. Because you’re saying your tool is a shell prompt! A shell prompt is the program that runs before and after every shell command…

The XDG Base Directory spec covers config/data/cache/state, it does not define where executables go. Whetuu history & cache are both compliant as both go to respectively ~/.local/share/whetuu/ ($XDG_DATA_HOME) & ~/.cache/whetuu/ ($XDG_CACHE_HOME).Atuin, cargo and many other tools are doing the same. By the way, Atuin also rebinds the up arrow.

Re: Show HN: Whetuu – a zero-config cross-shell prompt written in Zig

#25

Earlier quoted context omitted.

The XDG spec tells you exactly where to place your files. It isn’t in $HOME/.your-project ever. You know about XDG enough to mention in your docs, so you should know. It does hijacks shell history. If I press the up arrow, I expect _my shell_ to handle it how I configured it, not your tool. Because you’re saying your tool is a shell prompt! A shell prompt is the program that runs before and after every shell command…

The XDG Base Directory spec covers config/data/cache/state, it does not define where executables go. Whetuu history & cache are both compliant as both go to respectively ~/.local/share/whetuu/ ($XDG_DATA_HOME) & ~/.cache/whetuu/ ($XDG_CACHE_HOME).Atuin, cargo and many other tools are doing the same. By the way, Atuin also rebinds the up arrow.

The XDG Base Directory spec covers config/data/cache/state, it does not define where executables go.

it does:

https://specifications.freedesktop.org/basedir/latest/

User-specific executable files may be stored in $HOME/.local/bin. Distributions should ensure this directory shows up in the UNIX $PATH environment variable, at an appropriate place.

i prefer ~/bin/ but this is better than creating you own directory that needs to be added to the path.

Re: Show HN: Whetuu – a zero-config cross-shell prompt written in Zig

#26
post #7
post #2

please stop piping into bash or sh. force people to use the editor, read the install script, and tell them how to run it

"curl | sh" certainly feels wrong, but in the end, even if you download and read the script before running commands, let's be real: you are going to run a binary that you didn't inspect. Not saying you shouldn't check your scripts, I usually do, I like to know where the files are going in case the installer messes up, but the risks tend to be overstated compared to running the executable itself.

that's a fair point, but the script doesn't do much, and this method should not be normalized. i downloaded the release manually, unpacked it, and moved the binary into ~/bin/

what's left is adding the init command to the shell init script.

and it turns out that this is included as an alternate way to install in the repo README.

i really don't see the point of the install script. the verification it offers is of no value because if the repo is compromised then the install script could be compromised too.

Re: Show HN: Whetuu – a zero-config cross-shell prompt written in Zig

#27
a few questions:

i am confused by this line:

You need a Nerd Font. The prompt uses Nerd Font glyphs for the git branch, the language logos and the prompt character. Without one, those show as empty boxes.

this sounds like a nerdfont needs to be installed manually. but that doesn't seem to be the case because it just seems to work. and i don't remember installing such a font.

i also wonder what version it is showing when not in a git repo directory.

finally, how do i edit history entries before rerunning them?

Re: Show HN: Whetuu – a zero-config cross-shell prompt written in Zig

#28

Earlier quoted context omitted.

The XDG spec tells you exactly where to place your files. It isn’t in $HOME/.your-project ever. You know about XDG enough to mention in your docs, so you should know. It does hijacks shell history. If I press the up arrow, I expect _my shell_ to handle it how I configured it, not your tool. Because you’re saying your tool is a shell prompt! A shell prompt is the program that runs before and after every shell command…

The XDG Base Directory spec covers config/data/cache/state, it does not define where executables go. Whetuu history & cache are both compliant as both go to respectively ~/.local/share/whetuu/ ($XDG_DATA_HOME) & ~/.cache/whetuu/ ($XDG_CACHE_HOME).Atuin, cargo and many other tools are doing the same. By the way, Atuin also rebinds the up arrow.

We’ve been over this. Atuin is not a shell prompt.

Re: Show HN: Whetuu – a zero-config cross-shell prompt written in Zig

#29

Earlier quoted context omitted.

The XDG spec tells you exactly where to place your files. It isn’t in $HOME/.your-project ever. You know about XDG enough to mention in your docs, so you should know. It does hijacks shell history. If I press the up arrow, I expect _my shell_ to handle it how I configured it, not your tool. Because you’re saying your tool is a shell prompt! A shell prompt is the program that runs before and after every shell command…

The XDG Base Directory spec covers config/data/cache/state, it does not define where executables go. Whetuu history & cache are both compliant as both go to respectively ~/.local/share/whetuu/ ($XDG_DATA_HOME) & ~/.cache/whetuu/ ($XDG_CACHE_HOME).Atuin, cargo and many other tools are doing the same. By the way, Atuin also rebinds the up arrow.

> it does not define where executables go

It does. Read the spec. It’s in $HOME/.local/bin. It’s just not configurable like the other paths.

Re: Show HN: Whetuu – a zero-config cross-shell prompt written in Zig

#30
This isn't news, the real news is that the AI tooling allows YOU (specifically) to have a custom prompt tool built specifically for you, in the same or less effort it would take to set up one of the existing prompt tools.

For example, I liked the idea of this but had no interest in the shell history integration; I use atuin.

So I had codex build me one, including the 250ms wait for git, and if git takes longer than that it backgrounds it, uses the last git status until git can return an updated status. https://github.com/linsomniac/jafoprompt

Post reply on HN