12b60b8b29b6e0cefbb153de6c1bc1b16285d376
2 # Copyright (C) 2019 Ian Kelling
3 # SPDX-License-Identifier: AGPL-3.0-or-later
7 # redirect output to log file. this doesn't work. todo figure out why
8 #exec 1>>/a/tmp/bashlog
9 #exec 2>>/a/tmp/bashlog
13 # History related options first and always, or else we risk screwing up
14 # the history file. This is duplicated in ~/.bash_profile just for good
17 # History file size limit, set to unlimited.
18 # this needs to be different from the default because
19 # default HISTFILESIZE is 500 and could clobber our history
21 # max commands 1 session can append/read from history
23 # the time format display when doing the history command
24 # also, setting this makes the history file record time
25 # of each command as seconds from the epoch
26 HISTTIMEFORMAT
="%Y-%m-%d %I:%M %p "
27 # consecutive duplicate lines dont go in history
28 HISTCONTROL
=ignoredups
29 # This works in addition to HISTCONTROL to do more flexible things
30 # it could also do the same things as HISTCONTROL and thus replace it,
31 # but meh. dunno why, but just " *" does glob expansion, so use [ ] to avoid it.
32 HISTIGNORE
='pass *:otp *:oathtool *:histrm *'
34 # note: duplicated in /a/bin/ds/filesystem/etc/profile.d/environment.sh
40 # noninteractive ssh shells or tty). tty because often i use it when
41 # something is going and io is slow and my bashrc is too slow.
42 if [[ $LC_USEBASHRC != t
&& ( $SSH_CONNECTION ||
$TERM == linux
) ]]; then
43 # Here we did not opt-in to running our .bashrc file so we just
44 # return, but we still setup a function to source it without returning
45 # so if we want it we don't have to restart our ssh connection.
48 # shellcheck disable=SC1090 # obviously, no need to follow a sourcing of this file
54 ###### Begin sourcing of files #####
56 # The distinction between login and non-login shells is super lame
57 # and pretty random. get rid of that distinction.
58 if ! shopt -q login_shell
; then
59 if [[ -r /etc
/profile
]]; then
62 # note, this is not exactly the same as a login shell, because that
63 # reads ~/.bash_profile or alternative, which usually just sources
64 # this file, and we don't want to do that and cause an infinite
68 # source brc and brc2 if they exist. We have to readlink because we
69 # could be using sl() from ./brc.
70 _tmp
=$
(readlink
-f ${BASH_SOURCE[0]})
73 if [[ -s $bashrc_dir ]]; then
74 # shellcheck source=./brc
77 # brc2 is for things i dont necessarily want on every system
79 if [[ -s $_tmp ]]; then
80 # shellcheck source=./brc2
83 # This check is for when running the sl() command,
84 # and the remote host got its type misidentified.
85 _tmp
=$bashrc_dir/..
/brc2
86 if [[ -s $_tmp ]]; then
87 # shellcheck source=./brc2
91 if [[ $IANK_BASHRC_RUN ]]; then
94 ###### End sourcing of files #####
96 #### end section that works with sl() function to return from
97 #### noninteractive ssh shells
100 # ensure no bad programs appending to this file will have an affect
103 # kitty puts this here on startup, i need to build with some option to
104 # avoid it, whatever.
106 ## BEGIN_KITTY_SHELL_INTEGRATION
107 # if test -n "$KITTY_INSTALLATION_DIR" -a -e "$KITTY_INSTALLATION_DIR/shell-integration/bash/kitty.bash"; then source "$KITTY_INSTALLATION_DIR/shell-integration/bash/kitty.bash"; fi
108 ## END_KITTY_SHELL_INTEGRATION
110 # Automatically added by the Guix install script.
111 if [ -n "$GUIX_ENVIRONMENT" ]; then
112 if [[ $PS1 =~
(.
*)"\\$" ]]; then
113 PS1
="${BASH_REMATCH[1]} [env]\\\$ "