byobu/usr/bin/byobu-disable-prompt.in
Jeffery To b6fb57f94f * usr/bin/byobu-disable-prompt.in,
usr/bin/byobu-janitor.in:
  - Test if $HOME/.bashrc exists before modifying it (and potentially
    creating it)
2019-05-27 03:09:25 +08:00

41 lines
1.3 KiB
Bash
Executable File

#!/bin/sh -e
#
# byobu-disable-prompt
# Copyright (C) 2013-2014 Dustin Kirkland
#
# Authors: Dustin Kirkland <kirkland@byobu.org>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, version 3 of the License.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
PKG="byobu"
[ -r "$HOME/.byoburc" ] && . "$HOME/.byoburc"
[ -z "${BYOBU_PREFIX}" ] && export BYOBU_PREFIX="@prefix@" || export BYOBU_PREFIX
. "${BYOBU_PREFIX}/lib/${PKG}/include/common"
[ -w "$HOME/.bashrc" ] || exit 1
$BYOBU_SED_INLINE -e "/#byobu-prompt#$/d" "$HOME/.bashrc"
if [ "$1" != "--no-reload" ]; then
if [ -n "$TMUX" ] && [ "$SHELL" = "/bin/bash" ]; then
tmux send-keys " . ~/.bashrc" \; send-keys Enter
else
echo
echo "You will need to reload your shell configuration for this to take effect..."
echo " . ~/.bashrc"
echo
fi
fi
# vi: syntax=sh ts=4 noexpandtab