News for hackers. Stuff that matters.
Re:So you've installed `fzf`. Now what? by RustyRussell on Tuesday March 21, 2023 @07:26PM (#35254284)
FWIW I get a 503 on that URL. Any chance someone can give me that magic one-liner?
Re:So you've installed `fzf`. Now what? by jdhendrickson on Tuesday March 21, 2023 @07:34PM (#35254381)
Not sure what that link had as it's dead for me as well but...

PROMPT_COMMAND='history -a'

Has always worked for me. Goes in your .bashrc from the FM

PROMPT_COMMAND ¶ If this variable is set, and is an array, the value of each set element is interpreted as a command to execute before printing the primary prompt ($PS1). If this is set but not an array variable, its value is used as a command to execute instead.

Re:So you've installed `fzf`. Now what? by e12e on Tuesday March 21, 2023 @08:42PM (#35255054)
Looks like it is still down - but see eg: https://askubuntu.com/questions/67283/is-it-possible-to-make...

To wit:

> It says to put those commands in the .bashrc config:

    shopt -s histappend
    PROMPT_COMMAND="history -a;$PROMPT_COMMAND"
> The first command changes the history file mode to append and the second configures the history -a command to be run at each shell prompt. The -a option makes history immediately write the current/new lines to the history file.

I used to have something like this set up on my Linux laptop - the downside is that seperate shell/terminals/windows/tabs don't keep seperate history - so if you eg start a server in shell one (rails s), start editor in two - then go back to one and ctrl-c out - up arrow will now give you "vim" not "rails s".

The problem compounds if you ping, or curl in another shell etc.