Hacker Newsnew | past | comments | ask | show | jobs | submit | bwhaley's commentslogin

Once you start using CTRL+r, you may find that you never reach for up arrow again.


I'm familiar with ctrl-r, but I still very much like the up-arrow behavior described by that commenter.


Looking at it from a "law of least surprise" angle, it's exactly how it should behave.

"I typed 'cd di↑' and you're giving me 'pwd'??"


What I love about the default Bash Crtl-C behaviour is that once a command has been located, the bash history is moved to the history of that command, until Enter is pressed.

  $ a
  bash: a: command not found
  $ b
  bash: b: command not found
  $ c
  bash: c: command not found
  $ d
  bash: d: command not found
  $ <CTRL-R> b <UP>
  $ a
That's great if I don't remember which command I was experimenting with, but I do know other commands that I did around that time (usually a file that I edited with VIM).


Atuin[1] feels like the best of both worlds to me.

[1] https://github.com/atuinsh/atuin


Atuin looks pretty nice — I might give it a try.

I went down the “fully automatic history” path before, but it mostly turned into noise for me.

Keeping a tiny cheatsheet of things I had to look up twice ended up working better.


And once you want to one-up this look into fzf.


And once you get tired of fzf and want something better, you reach for https://atuin.sh.

Completely transformed all of my workflows


From the atuin.sh website

> Sync your shell history to all of your machines

I think of my shell history as very machine specific. Can you give some insights on how you benefit from history sync? If you use it.


That feature is entirely optional and disabled by default. Atuin stores your shell history locally in a sqlite db regardless of whether you choose to sync it. I thought fzf was fast, but atuin makes it look slow by comparison.


Same, I find shared history not very useful.

However what I do find useful is eternal history. It's doable with some .bashrc hacks, and slow because it's file based on every command, but:

- never delete history

- associate history with a session token

- set separate tokens in each screen, tmux, whatever session

- sort such that backward search (ctrl-R) hits current session history first, and the rest second

Like half my corporate brain is in a 11M history file at this point, going back years.

What I would love is to integrate this into the shell better so it's using sqlite or similar so it doesn't feel "sluggish." But even now the pain is worth the prize.


I just want to give a perspective of someone that uses the 'eternal history' in bash per Eli Bandersky [1] and reluctance to use something like atuin (without/ignoring shared history).

First, as for speed and responsiveness, if there is a degradation, it is imperceptible to me. I wouldn't have a clue that my interactive shell is slowing down because it is logging a command to ~/.persistent_history.

My persistent_history is 4MB and has been migrated from machine to machine as I've upgraded, it's never felt slow to edit with (neo)vim or search with system supplied grep.

Eli's way of doing it also includes the timestamps for all commands, so it's easy to trace back when I had run the command, and duplicates are suppressed. In fact my longest persistent_history goes back to 2019-07-04, so I've been using it for quite some time now.

But the larger point I wanted to make is that I wouldn't feel comfortable switching this, in my opinion, quite efficient setup to displace it with an sqlite database. That would require a special tool to drill through the history and search rendering simple unix utilities useless. As Eli suggested, if your history gets too big, simply rotate the file and carry on. I have the alias phgrep to grep ~/.persistent_history, but I can easily have another alias to grep ~/.persistent_history*.

[1]: https://eli.thegreenplace.net/2013/06/11/keeping-persistent-...


You don't have to setup shared history with Atuin if you don't want to and that's what's holding you back. Otherwise it hits the rest of your requirements. Just don't hesitate to change from the default config.


1. work on a project on host_foo in /home/user/src/myproject

2. clone it on host_bar in /home/user/src/myproject

If you set filter_mode = "directory", you can recall project specific commands from host_foo for use on host_bar even though you're working on different machines and the search space won't be cluttered with project specific commands for other projects.


I sync Atuin to my home server but I also configure it to be host specific by default.


There is a difference, I believe. Doesn't Ctrl+r do a substring search instead?


Yes it's different: it will match anywhere in the previous command lines.


If you use multiple terminals it kinda sucks unless you do export PROMPT_COMMAND='history -a' in your.bashrc or something cause only the last closed terminal saves to history


export EDITOR=vi and then hitting Esc puts you into vi mode; k, j to move up/down through history or pressing / to search etc including using regex is all available.


Prefix search is faster for the majority of cases. CTRL-r / FZF is useful for the remaining ones.


Ctrl-r can’t replace prefix search.


I really want to look at your art but it’s on twitter so I can’t!


oh yeah good point. i probably shouldn't link to that anymore. it's all on mastodon too! https://mastodon.social/@ianthehenry


This is the answer. I'd wager that almost every distributed system that runs at scale uses message queues in some capacity.


Also, as a vim user, modes are completely fine and I do not believe that modes slow me down. I’m not sure why the author is so insistent on this point.


Intuitively having to press more keys in order to accomplish an action sounds like it would be slower than a single key combo. Of course this fails to account for the fact that pressing something like Option+Fn+Backspace to forward-delete a word is far more awkward than f-d and therefore takes longer.


TIL Option+Fn+Delete can forward-delete a word! Thanks!


3-4 beers after work several days per week seems like a drinking problem imho.


A drinking problem isn't defined by quantity, it is when you have a problematic habit/dependence that you can't quit at will. There are plenty of people who enjoy a few drinks several days a week but can just cut back or stop completely when they want/need to because they don't have alcoholism.

I used to drink 3 beers almost every night. I cut down on it to lose weight and now have a single beer 2-3 nights a week and no alcohol other nights. Some weeks I have none. If I had an actual "drinking problem" i.e. alcoholism, I wouldn't have been able to do that.


That's like saying "repeatedly banging your head on the wall is not a problem; it's only a problem if you can't stop at will".

The latest science says no amount of alcohol is good for you. And there's plenty of evidence that any amount of alcohol is bad for you. Of course there is pleasure that comes with imbibing alcoholic drinks, unlike banging your head on the wall, but you are still damaging your body with every sip.

Unfortunately the words "alcoholic" and "addict" are difficult for people to accept and associated with only the worst cases. But I think addiction is far more common than we think.

I used to drink occasionally, maybe once a week, to slight excess which one might call "merry" or "tipsy". I would always sleep badly and feel terrible the next day. I would also eat essentially an extra meal after drinking (usually consisting of junk food). This would happen every single time and I observed that this commonly happened to others too on a regular occurrence. Knowing that these bad effects would ensue, continuing to drink made me an addict: I knew it was bad for me, but I did it anyway.


Substances affect different people differently. I can have 3-4 drinks in an evening without changing my eating or sleep habits at all and without feeling any different the next day.

Some people experience drinking-related issues other than alcoholism and I just don't want to conflate those issues with alcoholism. I know some actual alcoholics. It's different.


My measurement for this sort of thing is, "if there's none in my house tonight and I get a hankering, how willing am I to go out looking for it?"


Yeah. When I run out, I just add it to my grocery list and pick up some more the next time I go to the supermarket. Can't remember the last time I left my house specifically to buy alcohol.


With enough quantity it's a problem in itself even without alcoholism.


Before kids I had an active social life that could definitely be construed as a “drinking problem”. I’d argue that the benefits to my social life outweighed the harm to my health. IMHO, “problem” drinking is defined as the inability to stop drinking, i.e. a true addiction.


If you are regularly in social situations where you feel you can't participate without having several drinks, you have a drinking problem. It's still a problem even if it's driven by external pressure rather than an addiction.


By this definition, people who embrace high levels of alcohol consumption despite their obvious effects don't have a drinking problem, which seems a bit tentative to me. I would say someone like George Best very much had a drinking problem.


It is.


Depends on the beer. Measuring one beer as we donin Bavaria, in at least half litres, and meaning by multiple times a week more than three days, maybe. By measuring beer in 0.3 and 0.2 litres, ans assuming the average US beer, even doing so 5 days a week propably doesn't get into abuse territory by the alcohol amount alone.


In US culture/science, one "drink" or "beer" is 0.5oz of alcohol. Beer is often 12oz of 4% alcohol. Wine is 6oz of 9%. Liquor is 1oz or 50%, etc.

There are stronger drinks, but in this scientific context should be considered multi-drinks.

People not understanding this unit scale causes a lot of problems, like teens having 20-30oz pours of alcohol like it's (also ugh) soda or juice.

I wonder if European science and US science get muddied due to different "drij" sizes.


The average beer is closer to 5%, few wines are as low as 9% and nearly all mainstream liquor is exactly 40%.


I can't speak for all of Europe, but in Austria no-one speaks of "drinks" when talking about alcohol consumption. This concept of a standard "drink" size is foreign to me and I know it only from US literature.


Try the Waking Up app for a complete, organized collection of Watts’s work. I don’t take all of it at face value - some of it certainly hasn’t aged well - but I’ve derived a lot of wisdom from his work. If you’re interested in looking at the world a little differently then the typical western way, it’s worth your time to give his talks a listen.


What parts of his work haven't aged well?


Pretty much everything he wrote on drinking aged poorly when seen in the light of his eventual demise by drinking himself to death.


Probably when he talks about gender.


> Notexisting is worse than pain and suffering.

That’s a stretch.

Far more important to come to terms with mortality than extend life indefinitely.

Is it even still living to have a heartbeat but with motor control, limited or no ability to speak, and no memory? Is “living” in this way best for the next of kin?

I found a recent episode of the Making Sense podcast in this topic to be thought provoking. You might give it a listen.

https://www.samharris.org/podcasts/making-sense-episodes/297...


That white paper is an incredible piece of technical documentation. Accessible to anyone with a basic background in computing and operating systems. I love hidden gems like this.


A favorite part of mine is the explanation of capabilities versus ACLs that it provides.


Fine y'all have convinced me to take a look


Perhaps you’d like the Gruntwork reference architecture diagram made with CloudCraft:

https://gruntwork.io/reference-architecture/


And the annual tax is if you're doing business in CA, even if you filed articles of organization in another state. Once you clear $250k it goes up to $1700!


Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: