Complete Computing Environment: Shell Configuration

Table of Contents

(provide 'cce-shells)

BASh

There's not much here right now, since I'm not a huge user of the shell. Instead, I opt to wrap most repetitive things in Emacs commands. As such, I opt for a very light configuration over the top of bash to provide enough affordances to make it useful.

Bash Configuration Loader

It's possible for multiple CCE modules to push out Bash configurations, so each one tangles to its own file which is then executed as so:

- name: bashrc.d assembled
  become: yes
  become_user: rrix
  assemble:
    src: out/bashrc.d
    dest: ~/.bash_profile
    mode: 0755
    remote_src: False
export PATH=$PATH:~/bin/

test -f /etc/bash_profile && . /etc/bash_profile

I am in San Francisco. This used to be a UTC setup, but it's really hard to make that work sanely, so I don't.

export TZ=America/Los_Angeles
export PS1="\[\033[01;32m\]\u@\h\[\033[00m\]:\[\033[01;34m\]\w \[\033[00m\]\`if [ \$? == 0 ]; then echo \:\); else echo \:\(; fi\` "
test -f /etc/bashrc && . /etc/bashrc

shell-mode

Emacs has Shell Mode, a simple comint-mode backed shell that lets me do simple crap that don't need ncurses or anything like that. It uses bash and works sanely with pipelines, unlock eshell and doesn't eat my keybindings like ansi-term and term.

As of my latest Emacs update, shell-mode displays buffers in a new window when I do M-x shell which is almost always not what I want, instead opting for them to always appear in the same window as my cursor.

(add-to-list 'display-buffer-alist
             `(,(regexp-quote "*shell") display-buffer-same-window))

Author: Ryan Rix

Created: 2017-10-03 Tue 10:07

Validate XHTML 1.0