0
Fork 0
soda/content/now/2026-04-18.mdx
2026-04-18 22:41:23 +02:00

44 lines
1.5 KiB
Text

import Shell from "#components/Shell.astro"
import Command from "#components/Shell/Command.astro"
cleaned up `$PROMPT` a bit on servers today :3
previously, <object /> had to remember which host it was on when using ssh:
<Shell>
<Command host="ber1" cmd="whoami" root style="minimal" cwd="/etc/bird" />
root
<Command host="owl" cmd="whoami" style="minimal" cwd="~/.config" />
ana
</Shell>
now it's using `$RPROMPT` to display the hostname:
<Shell>
<Command host="ber1" cmd="whoami" root cwd="/etc/bird" />
root
<Command host="owl" cmd="whoami" cwd="~/.config" />
ana
</Shell>
tiny change but really useful :]
```diff
- PROMPT='%F{magenta}%~ %# %f'
+ PROMPT='%F{magenta}%~ %F{8}%# %f'
+ RPROMPT='%F{8}%m%f'
```
here's a screenshot of how it looks on <object />'s different servers:
![
screenshot with multiple tiled ghostty windows.
they are each just sitting in the home directory on different hosts.
"owl" and "needletail" have a purple prompt indicating a non-root user, "ber1" and "web" have a red prompt indicating root.
on the right, there's a window with an orange prompt and no hostname field, presumably the device the screenshot was taken on.
](https://geo.thei.rs/-/0G0BbWI6.png "web is using starship, and gaia (right) is using p10k, so they look slightly different")
oh, and for showcasing this:
- built little `<Shell />` and `<ShellCommand />` components
- added some theming to astro's code blocks
- made a custom shiki theme that matches the rest of the colors :3