May 17, 2012

Auto-attaching to Screen using Fish Shell

Another post about the excellent Fish Shell, this time about how to configure it to automatically start "Screen"

Using the simple and clean fish shell language, I whipped up this little function, which will start screen, reattaching to the old session if possible, and starting a new one instead if not:

function screen_auto_attach
  if [ -z "$STY" ]
    exec screen -dR
  end
end

Then just call it from your .config/fish/config.fish shell with “screen_auto_attach”.

Using Virtualenv with Fish Shell

I am a huge fan of the fish shell, and I wanted to use Python virtual environments conveniently while in the shell.

Of course, if I was using cranky-old-bash-shell, I’d just use the excellent “virtualenvwrapper“, but I’m not.

It turned out to be not that difficult to make a workalike to virtualenvwrapper using Fish, including help and tab completion of environments.
[Read more...]

Technorati Tags: , ,