byobu produces strange output when run from crontab, screen doesn't

Asked by Thorsten Kunz

I am not 100% certain that this is a bug or some kind of feature that I just don't get but when I put byobu into a users crontab like this:

@reboot env TERM=xterm byobu -A -d -m -S pegasus sh -c 'somelongrunningcommnd; read'

It is actually working as intended but I get an email with a strange message body after every reboot:

]0;@pegasus - byobu

Now when I replace byobu with plain vanilla screen I get no mail.

Am I missing something?

Thanks

Question information

Language:
English Edit question
Status:
Answered
For:
byobu Edit question
Assignee:
No assignee Edit question
Last query:
Last reply:
Revision history for this message
Dustin Kirkland  (kirkland) said :
#1

What' you're seeing is the result of a "printf" that sets the window
title in a program, like gnome-terminal. In gnome-terminal, try
ssh'ing to a system that launches Byobu, and in the window title, you
should see something like 'kirkland@x201 - byobu'. At least that's
what it is for my user@host.

I suspect you might be able to solve this with a >/dev/null, perhaps?

If not, I can try working with you on finding the correct conditional
logic to "not" print this in your crontab case.

See the lines in /usr/bin/byobu:
# Set the window title
printf "\033]0;${USER}@$(hostname) - ${PKG}\007"

We'd need to wrap that with some logic, perhaps keyed on what your
TERM value is?

--
:-Dustin

Revision history for this message
Thorsten Kunz (sfire) said :
#2

Well the /dev/null redirect is avoiding the email message but for various reasons I would prefer a non output redirecting solution if possible (and not too much work for you).
However I don't think the TERM value should be used. TERM values are already used for so much magic in all kinds of places that I would rather not overload it even more. What about a simple environment variable along the line of BYOBU_SET_WINDOW_TITLE=0 with a default to 1? This way it would be backwards compatible without breaking peoples existing configurations.

Just my 2 cents...

Revision history for this message
Dustin Kirkland  (kirkland) said :
#3

On Thu, May 5, 2011 at 4:15 AM, Thorsten Kunz
<email address hidden> wrote:
> Thorsten Kunz posted a new comment:
> Well the /dev/null redirect is avoiding the email message but for various reasons I would prefer a non output redirecting solution if possible (and not too much work for you).
> However I don't think the TERM value should be used. TERM values are already used for so much magic in all kinds of places that I would rather not overload it even more. What about a simple environment variable along the line of BYOBU_SET_WINDOW_TITLE=0 with a default to 1? This way it would be backwards compatible without breaking peoples existing configurations.

Simple, elegant. I like it. Would you mind filing a bug against
byobu and request this? I'll get that committed as soon as you do ;-)

--
:-Dustin

Can you help with this problem?

Provide an answer of your own, or ask Thorsten Kunz for more information if necessary.

To post a message you must log in.