byobu prompt

Bug #2067490 reported by Djerk Geurts
18
This bug affects 3 people
Affects Status Importance Assigned to Milestone
byobu (Ubuntu)
Triaged
Undecided
Unassigned

Bug Description

Byobu on Ubuntu 24.04 shows a timer before the user prompt. The timer appears to display how long the previous command took. This is causing screen corruption when navigating previous commands as the cursor position is wrong and I've not found a way to disable the times from showing.

Experienced both on a dist-upgrade from 22.04 via 23.10, and ona clean install of 24.04. Both server distros.

Example prompts:
[0.015s] dgeurts@nfc00:~$ lsb_release -rd
No LSB modules are available.
Description: Ubuntu 24.04 LTS
Release: 24.04
[0.010s] dgeurts@nfc00:~$ apt-cache policy byobu
byobu:
  Installed: 6.11-0ubuntu1
  Candidate: 6.11-0ubuntu1
  Version table:
 *** 6.11-0ubuntu1 500
        500 http://archive.ubuntu.com/ubuntu noble/main amd64 Packages
        100 /var/lib/dpkg/status

Expected prompt:
dgeurts@nfc00:~$

Tags: byobu
Revision history for this message
Paride Legovini (paride) wrote :

Hello and thanks for this bug report. Can you please elaborate on what you mean with "navigating previous commands"? I briefly tested byobu 6.11-0ubuntu1 and the cursor is always at the end of the prompt, where I expect it to be. With "arrow up" I can get the previous commands and nothing looks misaligned, but again I am not sure this is what you mean.

Changed in byobu (Ubuntu):
status: New → Incomplete
Revision history for this message
Djerk Geurts (djerkg) wrote :

The best way to describe it, is that it's like when you cat a file without propper formatting and the command output pushes the prompt to the right. This causes a mismatch between where the cursor is shown and where it actually is.

Either way, the issue is more with why it's showing an elapsed time for the last command, which is a change from how the byobu prompts has worked to date.

Revision history for this message
Mitchell Dzurick (mitchdz) wrote :

Hi Djerk,

The default byobu prompt was updated since Ubuntu Noble to show the time elapsed from the previous command. You can see this code in /usr/share/byobu/profiles/bashrc

You can see this profile is being applied at the end of your ~/.bashrc file.

At the moment I don't think there's a way to explicitly disable just the timer, but feel free to create your own profile and/or modify your ~/.bashrc to remove the timer.

Revision history for this message
Mitchell Dzurick (mitchdz) wrote :

I'm also curious about the screen corruption and I'd like to reproduce it in-case it is a real bug others are experiencing.

Djerk, how are you connecting to your system you are running byobu on? Is this a local system or are you connecting to a remote system and then invoking byobu?

Revision history for this message
Dustin Kirkland  (kirkland) wrote :

You can byobu-disable-prompt if you want to turn it off.

I think I've reproduced this, when the command line wraps the screen, there's some corruption.

I don't have a fix yet. Patches accepted, if someone finds the right fix...

Revision history for this message
Djerk Geurts (djerkg) wrote :

I like the byobu prompt, just not the timer.

Thank you for looking into the corruption.

Revision history for this message
Djerk Geurts (djerkg) wrote :

Just found this, I thought I had sent it, but hadn't.

I trashed the system I did a dist-upgrade on, but testing on the clean install I can reproduce the 'corruption' I mentioned:

[10.339s] user@ubuntu24:~$ sudo vi /usr/share/byobu/profiles/bashrc
 user@ubuntu24:~$ sudo vi /usr/share/byobu/profiles/bashrc
[4.131s] user@ubunsudo vi /usr/share/byobu/profiles/bashrc
[2.645s] user@ubun

To reproduce: by executing a command, vim in the example above, and when closing it the prompt looks good. Up arrow shows the previous command, but then down arrow removes part of the prompt. Hitting up arrow again then puts the previous command at the depth where it would have been without the timer.

As for the runtime being part of the prompt, I'll have a look to see if overwriting PS1 works.

The default in /usr/share/byobu/profiles/bashrc:
export PS1="${debian_chroot:+($debian_chroot)}\[\e[38;5;202m\]\$(byobu_prompt_status)\[\e[00m\]\$(byobu_prompt_runtime) \[\e[38;5;245m\]\u\[\e[00m\]@\[\e[38;5;172m\]\h\[\e[00m\]:\[\e[38;5;5m\]\w\[\e[00m\]\$(byobu_prompt_symbol) "

This removes the timer when put in ~/.bashrc:
export PS1="${debian_chroot:+($debian_chroot)}\[\e[38;5;202m\]\$(byobu_prompt_status)\[\e[00m\]\[\e[38;5;245m\]\u\[\e[00m\]@\[\e[38;5;172m\]\h\[\e[00m\]:\[\e[38;5;5m\]\w\[\e[00m\]\$(byobu_prompt_symbol) "

I like the byobu prompt, but editing a user's .bashrc file isn't practical when users can enable and disable byobu which would change the order of the last lines in this file. Would updates to byobu undo edits to the system byobu bashrc profile, and would apt complain about changed files?

Changed in byobu (Ubuntu):
status: Incomplete → Triaged
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.