Stop Byobu Starting Automatically at Login
You will remove Byobu's automatic login launcher from your user shell files, stop the automatic Byobu message-of-the-day behaviour, and leave a persistent flag that disables launcher autostart. The examples use Byobu 6.11, installed here as Ubuntu package version 6.11-0ubuntu1.1. Allow about ten minutes, plus a little longer if you want to inspect and back up each profile first.
The route
Jump straight to the step you need, or tick off Done means at the end.
This is a per-user operation. You need a shell and a working Byobu installation. It normally needs no sudo: the utility edits files below your home directory. Do not run it as root unless you have deliberately decided which root user's login files should change.
1. Confirm the installed command
Check the executable and package version before changing anything. These are ordinary read-only commands:
$ command -v byobu-launcher-uninstall
/usr/bin/byobu-launcher-uninstall
$ dpkg-query -W -f='${Package} ${Version}\n' byobu
byobu 6.11-0ubuntu1.1
The installed manual describes this command as removing the launcher line added to $HOME/.profile. The current script also examines a small set of other shell startup files and writes a Byobu configuration flag, so the actual scope is wider than the one file named in the short description.
2. Inspect the files that may change
With no argument, the utility checks these files in your home directory: .profile, .bashrc, .bash_profile, .bash_login, .zprofile and .config/fish/config.fish. It only edits a file that exists and is writable. Inspect the relevant files first:
$ for file in "$HOME/.profile" "$HOME/.bashrc" "$HOME/.bash_profile" \
"$HOME/.bash_login" "$HOME/.zprofile" "$HOME/.config/fish/config.fish"; do
if [ -f "$file" ]; then
printf '\n--- %s ---\n' "$file"
grep -nE 'byobu-launch|screen-launch|_byobu_sourced' "$file" || true
fi
done
Look for a line that launches Byobu, rather than deleting every line containing the word. The utility keeps comment lines and removes lines matching the launcher patterns used by Byobu. It prints no success summary, so this inspection is your first checkpoint.
3. Back up the startup files
Removing lines from a shell profile changes how future login shells start. Make a dated copy of each file you plan to let the utility edit:
$ backup="$HOME/byobu-launcher-backup-$(date +%Y%m%d-%H%M%S)"
$ mkdir "$backup"
$ for file in "$HOME/.profile" "$HOME/.bashrc" "$HOME/.bash_profile" \
"$HOME/.bash_login" "$HOME/.zprofile" "$HOME/.config/fish/config.fish"; do
if [ -f "$file" ]; then
cp --preserve=all "$file" "$backup/$(basename "$file")"
fi
done
$ printf 'backup: %s\n' "$backup"
Keep the printed directory until you have tested a new login. The backup is ordinary user data, so protect it if the profile contains private settings.
4. Remove the launcher and disable autostart
Run the command without arguments:
$ byobu-launcher-uninstall
No normal output is expected. The command removes matching launcher lines from writable files in the list above. It then creates the Byobu configuration directory if necessary and touches disable-autolaunch there. The directory is selected from BYOBU_CONFIG_DIR, or from the usual Byobu configuration location when that variable is unset. Finally, it removes $HOME/.hushlogin, allowing the normal login message to be printed again.
These last two actions are easy to miss. This is not only a line-removal command: it changes Byobu's persistent autostart state and login-message behaviour. It does not require a service restart, and it does not edit a system-wide profile.
Checkpoint
Close the current shell only after verifying the changes in the next step. Existing Byobu sessions are not stopped by this command; the change applies to later logins.
5. Verify the result
Repeat the profile search. A successful run should leave no Byobu or screen launcher line in the writable files that contained one:
$ grep -RniE 'byobu-launch|screen-launch|_byobu_sourced' \
"$HOME/.profile" "$HOME/.bashrc" "$HOME/.bash_profile" \
"$HOME/.bash_login" "$HOME/.zprofile" "$HOME/.config/fish/config.fish" \
2>/dev/null || echo 'no launcher lines found'
no launcher lines found
Check the persistent flag and the restored login-message file:
$ config_dir="${BYOBU_CONFIG_DIR:-${XDG_CONFIG_HOME:-$HOME/.config}/byobu}"
$ test -f "$config_dir/disable-autolaunch" && echo 'autolaunch disabled'
autolaunch disabled
$ test ! -e "$HOME/.hushlogin" && echo '.hushlogin absent'
.hushlogin absent
The configuration path can differ when you have set BYOBU_CONFIG_DIR or have an older $HOME/.byobu directory. To see the path used by the installed scripts, run printf '%s\n' "${BYOBU_CONFIG_DIR:-not-exported}" before the command, or inspect both likely locations.
6. Target one profile deliberately
If you need to remove launcher lines from one particular file, pass its path as the only argument:
$ byobu-launcher-uninstall "$HOME/.profile"
An explicit path does not turn the operation into a dry run. It still performs the global Byobu configuration actions, including creating disable-autolaunch and removing .hushlogin. The path must name an existing regular file, and it must be writable for its launcher lines to be changed. Use this form when you have reviewed the other startup files and intentionally want to leave them alone.
7. Recover if a login behaves differently
If a shell no longer starts with your expected environment, do not guess at edits. Open the backup directory printed earlier and restore the affected file:
$ cp --preserve=all "$backup/.profile" "$HOME/.profile"
Replace .profile with the file you need. Restoring a profile does not remove the persistent Byobu flag, so a restored launcher line can still be suppressed by the flag. To restore the previous Byobu launcher setup as a complete operation, use the companion installer after reviewing its options:
$ byobu-launcher-install
The installer calls the uninstaller as part of its setup, adds its launcher line again, removes the disable flag, and recreates .hushlogin. It changes login behaviour, so run it as the intended user and verify the resulting profile before opening a new session. Do not use both commands in an automated login hook.
Done means
- The installed Byobu version and launcher files were identified before editing.
- A backup exists for each startup file that could be changed.
byobu-launcher-uninstallremoved the launcher lines from the intended writable files.disable-autolaunchexists in the active Byobu configuration directory..hushloginis absent, and future logins can show the normal message.- Existing Byobu sessions were left running, and the backup remains available for recovery.