Live data from Hacker News

Fixing macOS Zsh Terminal History Settings

blog.akatz.org

1–10 of 66 posts

Re: Fixing macOS Zsh Terminal History Settings

#2
I often have multiple concurrent sessions of terminal open, which leads to messed up history interactions. One solution I've encountered (but have not tested yet) is zsh-histdb [0]. It stores sessions' history to a SQLite db instead of a single appended file, with extra metadata about when commands were run, what session, etc. If you've already got your .zshrc file open to mess with the history settings it might be worth checking out that tool while you're at it.

0: https://github.com/larkery/zsh-histdb

Re: Fixing macOS Zsh Terminal History Settings

#3
OT but the first command I type on a new install of MacOS is

  $ chsh -s /bin/bash
because I have 20 years worth of bash scripts that I've carefully tailored to work on bash in MacOS and Linux and I don't have time to rewrite them all just because Apple decided they don't like GPLv3.

Re: Fixing macOS Zsh Terminal History Settings

#4

OT but the first command I type on a new install of MacOS is $ chsh -s /bin/bash because I have 20 years worth of bash scripts that I've carefully tailored to work on bash in MacOS and Linux and I don't have time to rewrite them all just because Apple decided they don't like GPLv3.

Before they changed the default the first command I had to type on a new install was

    $ chsh -s /bin/zsh 
You can’t please everybody.

Re: Fixing macOS Zsh Terminal History Settings

#5

OT but the first command I type on a new install of MacOS is $ chsh -s /bin/bash because I have 20 years worth of bash scripts that I've carefully tailored to work on bash in MacOS and Linux and I don't have time to rewrite them all just because Apple decided they don't like GPLv3.

You could still use those scripts with a shebang, no?

Re: Fixing macOS Zsh Terminal History Settings

#6

OT but the first command I type on a new install of MacOS is $ chsh -s /bin/bash because I have 20 years worth of bash scripts that I've carefully tailored to work on bash in MacOS and Linux and I don't have time to rewrite them all just because Apple decided they don't like GPLv3.

It's still bash 3 though, right? You're okay with that? I tend to install the newest from brew.

Re: Fixing macOS Zsh Terminal History Settings

#7

I often have multiple concurrent sessions of terminal open, which leads to messed up history interactions. One solution I've encountered (but have not tested yet) is zsh-histdb [0]. It stores sessions' history to a SQLite db instead of a single appended file, with extra metadata about when commands were run, what session, etc. If you've already got your .zshrc file open to mess with the history settings it might be w…

If somebody is interested in macos app for storing your history (bash,zsh,fish) and syncing it with icloud, I have built an app ShellHistory, v2 is available via TestFlight if you want to try it. https://loshadki.app/blog/2022-09-22-public-beta-shellhistor... (monterey and ventura) And this is a link to v1 https://loshadki.app/shellhistory/ (big sur+)

Re: Fixing macOS Zsh Terminal History Settings

#8

OT but the first command I type on a new install of MacOS is $ chsh -s /bin/bash because I have 20 years worth of bash scripts that I've carefully tailored to work on bash in MacOS and Linux and I don't have time to rewrite them all just because Apple decided they don't like GPLv3.

? Don't you just make the scripts start with `#!/user/bin/env bash`? Or do you mean aliases/functions?

Re: Fixing macOS Zsh Terminal History Settings

#10

OT but the first command I type on a new install of MacOS is $ chsh -s /bin/bash because I have 20 years worth of bash scripts that I've carefully tailored to work on bash in MacOS and Linux and I don't have time to rewrite them all just because Apple decided they don't like GPLv3.

I I do not do this because I have 20 years of zsh scripts.

Also, I like zsh better.

Post reply on HN