$TERM set to empty string in debug-hooks environment results in bad UX

Bug #1838772 reported by Michael Skalka
12
This bug affects 2 people
Affects Status Importance Assigned to Milestone
Canonical Juju
Fix Released
Medium
Dmitrii Shcherbakov

Bug Description

Currently within the debug-hooks environment the TERM environmental variable is not set. This results in some rough edges while performing debugging.

root@juju-7cdf35-3-lxd-1:~# env|grep TERM
TERM=
root@juju-7cdf35-3-lxd-1:~# clear
'': unknown terminal type.

It would be a nice QoL improvement to set TERM to something like `xterm`, or `xterm-256color` to enable some nice functionality (such as clearing the screen) without much effort.

Revision history for this message
John A Meinel (jameinel) wrote : Re: [Bug 1838772] [NEW] $TERM set to empty string in debug-hooks environment results in bad UX

https://wiki.archlinux.org/index.php/tmux#Correct_the_TERM_variable_according_to_terminal_type

I wonder if we could put that into a tmux.conf for root, so when you run
debug-hooks it can try to figure it out? It seems the relevant line is:
set -g update-environment 'DISPLAY SSH_ASKPASS SSH_AGENT_PID SSH_CONNECTION
WINDOWID XAUTHORITY TERM'

We could potentially default to a given term like xterm, but the whole
point of TERM is it depends on who is on the other end of SSH (are you
running in gnome-terminal, or xterm, or cygwin's tty)

On Fri, Aug 2, 2019 at 10:10 AM Michael Skalka <email address hidden>
wrote:

> Public bug reported:
>
> Currently within the debug-hooks environment the TERM environmental
> variable is not set. This results in some rough edges while performing
> debugging.
>
> root@juju-7cdf35-3-lxd-1:~# env|grep TERM
> TERM=
> root@juju-7cdf35-3-lxd-1:~# clear
> '': unknown terminal type.
>
> It would be a nice QoL improvement to set TERM to something like
> `xterm`, or `xterm-256color` to enable some nice functionality (such as
> clearing the screen) without much effort.
>
> ** Affects: juju
> Importance: Undecided
> Status: New
>
> --
> You received this bug notification because you are subscribed to juju.
> Matching subscriptions: juju bugs
> https://bugs.launchpad.net/bugs/1838772
>
> Title:
> $TERM set to empty string in debug-hooks environment results in bad UX
>
> To manage notifications about this bug go to:
> https://bugs.launchpad.net/juju/+bug/1838772/+subscriptions
>

John A Meinel (jameinel)
Changed in juju:
status: New → Triaged
importance: Undecided → Medium
tags: added: debug-hooks papercut
Revision history for this message
Dmitrii Shcherbakov (dmitriis) wrote :

Editing code in-place for debugging purposes is a bit of a pain without TERM set correctly so I created this: https://github.com/juju/juju/pull/10720

Changed in juju:
status: Triaged → Fix Committed
assignee: nobody → Dmitrii Shcherbakov (dmitriis)
Harry Pidcock (hpidcock)
Changed in juju:
milestone: none → 2.8-rc1
status: Fix Committed → Fix Released
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.