diff --git a/usr/bin/byobu b/usr/bin/byobu
index 362c10e6..14dfd648 100755
--- a/usr/bin/byobu
+++ b/usr/bin/byobu
@@ -19,7 +19,14 @@
PKG="byobu"
VERSION=2.83
-[ -z "$BYOBU_PREFIX" ] && BYOBU_PREFIX="/usr"
+[ -z "$BYOBU_PREFIX" ] && export BYOBU_PREFIX="/usr"
+export BYOBU_PREFIX
+
+if [ ! -x "$BYOBU_PREFIX/bin/$PKG" ]; then
+ echo "ERROR: Cannot find $BYOBU_PREFIX/bin/$PKG" 2>&1
+ echo "ERROR: If you have installed it elsewhere, export BYOBU_PREFIX in your shell" 2>&1
+ exit 1
+fi
# Add a version argument for debugging purposes
if [ "$#" = "1" ] && [ "$1" = "-v" ]; then
diff --git a/usr/bin/byobu-janitor b/usr/bin/byobu-janitor
index 447d108d..3423a8ef 100755
--- a/usr/bin/byobu-janitor
+++ b/usr/bin/byobu-janitor
@@ -20,7 +20,7 @@
# along with this program. If not, see .
PKG="byobu"
-[ -z "$BYOBU_PREFIX" ] && BYOBU_PREFIX="/usr"
+[ -z "$BYOBU_PREFIX" ] && export BYOBU_PREFIX="/usr"
[ -r "/etc/$PKG/socketdir" ] && . "/etc/$PKG/socketdir" || SOCKETDIR="/var/run/screen"
RUN="$SOCKETDIR/S-$USER"
FLAG="$RUN/$PKG.reload-required"
diff --git a/usr/bin/byobu-launcher b/usr/bin/byobu-launcher
index 130f2054..ce15f490 100755
--- a/usr/bin/byobu-launcher
+++ b/usr/bin/byobu-launcher
@@ -17,7 +17,8 @@
# You should have received a copy of the GNU General Public License
# along with this program. If not, see .
-[ -z "$BYOBU_PREFIX" ] && BYOBU_PREFIX="/usr"
+[ -z "$BYOBU_PREFIX" ] && export BYOBU_PREFIX="/usr"
+export BYOBU_PREFIX
if [ ! -e "$HOME/.byobu/disable-autolaunch" ]; then
case "$TERM" in
diff --git a/usr/bin/byobu-select-profile b/usr/bin/byobu-select-profile
index 2966075f..9327d01b 100755
--- a/usr/bin/byobu-select-profile
+++ b/usr/bin/byobu-select-profile
@@ -23,7 +23,8 @@
# ./debian/rules get-po
PKG="byobu"
-[ -z "$BYOBU_PREFIX" ] && BYOBU_PREFIX="/usr"
+[ -z "$BYOBU_PREFIX" ] && export BYOBU_PREFIX="/usr"
+export BYOBU_PREFIX
[ -r "/etc/$PKG/socketdir" ] && . "/etc/$PKG/socketdir" || SOCKETDIR="/var/run/screen"
TEXTDOMAIN="$PKG"
diff --git a/usr/bin/byobu-status b/usr/bin/byobu-status
index 36b7c0fc..3fe4b835 100755
--- a/usr/bin/byobu-status
+++ b/usr/bin/byobu-status
@@ -18,7 +18,8 @@
# along with this program. If not, see .
PKG="byobu"
-[ -z "$BYOBU_PREFIX" ] && BYOBU_PREFIX="/usr"
+[ -z "$BYOBU_PREFIX" ] && export BYOBU_PREFIX="/usr"
+export BYOBU_PREFIX
find_script () {
# Allow for local status scripts
diff --git a/usr/share/byobu/keybindings/f-keys b/usr/share/byobu/keybindings/f-keys
index 4aac9f00..d3f75f49 100644
--- a/usr/share/byobu/keybindings/f-keys
+++ b/usr/share/byobu/keybindings/f-keys
@@ -41,5 +41,5 @@ register s "^a[g G$>^h" # Goes with ^a~ definition
bind ~ eval 'process s' 'exec sed -i "/./,/^$/!d" /var/run/screen/S-$USER/byobu-exchange' 'echo "See: /var/run/screen/S-$USER/byobu-exchange"' # ctrl-a ~ | write the buffer to file
# toggle f-key keybindings off
-register d "^a:source /usr/share/byobu/keybindings/screen-escape-keys^M"
+register d "^a:source $BYOBU_PREFIX/share/byobu/keybindings/screen-escape-keys^M"
bind ! eval 'process d' 'backtick 111 9999999 9999999 byobu-status menu --disable-f-keys'
diff --git a/usr/share/byobu/keybindings/screen-escape-keys b/usr/share/byobu/keybindings/screen-escape-keys
index 076b5ae9..75103c3b 100644
--- a/usr/share/byobu/keybindings/screen-escape-keys
+++ b/usr/share/byobu/keybindings/screen-escape-keys
@@ -48,5 +48,5 @@ bind @ screen -t config 0 byobu-config
# ctrl-a-$ Show detailed status
bind $ screen -t status 0 byobu-status-detail
# ctrl-a-! Toggle f-key keybindings on
-register e "^a:source /usr/share/byobu/keybindings/f-keys^M"
+register e "^a:source $BYOBU_PREFIX/share/byobu/keybindings/f-keys^M"
bind ! eval 'process e' 'backtick 111 9999999 9999999 byobu-status menu'
diff --git a/usr/share/byobu/tests/byobu-time-notifications b/usr/share/byobu/tests/byobu-time-notifications
index a7d0c462..f1edf0f3 100755
--- a/usr/share/byobu/tests/byobu-time-notifications
+++ b/usr/share/byobu/tests/byobu-time-notifications
@@ -21,6 +21,8 @@
PKG=byobu
RUNS=100
+[ -z "$BYOBU_PREFIX" ] && BYOBU_PREFIX="/usr"
+export BYOBU_PREFIX
loop() {
for j in $(seq 1 $RUNS); do