Live data from Hacker News

Unix Tricks

cfenollosa.com

11–20 of 166 posts

Re: Unix Tricks

#12
post #7

One to add: Unfreezing terminal after pressing Ctrl+S by accident. Press Ctrl-Q.

Or drop a `stty -ixon` into your .bash_profile to never have that problem again.

Re: Unix Tricks

#14
You know what I hate? My history isn't aggregated in real time across all my Mac OS X terminal windows.

You know what else I hate? Typing in long commands in the Mac OS X terminal and then them wrapping weirdly. Especially when I hit the up arrow to go back in my terminal history.

Re: Unix Tricks

#16

You know what I hate? My history isn't aggregated in real time across all my Mac OS X terminal windows. You know what else I hate? Typing in long commands in the Mac OS X terminal and then them wrapping weirdly. Especially when I hit the up arrow to go back in my terminal history.

> My history isn't aggregated in real time across all my Mac OS X terminal windows.

zsh has `setopt inc_append_history` and `setopt share_history`. i am sure bash has something similar.

Re: Unix Tricks

#17

You know what I hate? My history isn't aggregated in real time across all my Mac OS X terminal windows. You know what else I hate? Typing in long commands in the Mac OS X terminal and then them wrapping weirdly. Especially when I hit the up arrow to go back in my terminal history.

Here you go, just throw it in your .bashrc:

  shopt -s histappend
  export HISTSIZE=100000
  export HISTFILESIZE=100000
  export HISTCONTROL=ignoredups:erasedups
  export PROMPT_COMMAND="history -a;history -c;history -r;$PROMPT_COMMAND"
I wish I could give credit to where I originally found this but it was ages ago.

Re: Unix Tricks

#18

You know what I hate? My history isn't aggregated in real time across all my Mac OS X terminal windows. You know what else I hate? Typing in long commands in the Mac OS X terminal and then them wrapping weirdly. Especially when I hit the up arrow to go back in my terminal history.

> You know what else I hate? Typing in long commands in the Mac OS X terminal and then them wrapping weirdly.

I solved this by adding the following line in my ~/.bashrc

  shopt -s checkwinsize
Never tried on Mac OS X though, so I don't know if it works.

Re: Unix Tricks

#20

You might want to try out the more modern fish shell as well: http://fishshell.com/ It makes history searching even easier.

I love fish and have happily been using it for years. Every time it comes up here, though, someone inevitably will complain about compatibility - and I will admit that RVM, for instance, has definitely caused me problems with fish in the past. I guess it depends quite a lot on your particular usage and requirements.
Post reply on HN