Public bug reported:

The new-ish "apt" command draws its progress bar and produces escape
codes regardless of advertised terminal capabilities; in particular,
with TERM=dumb, "apt" still produces save_cursor and restore_cursor
escape codes ("\0337" and "\0338"), in addition to colors and other ANSI
escapes.

An example of a commonly used shell with TERM=dump is Emacs' shell
buffers.  In these, running "apt" produces the following:

```
(Reading database ... 363533 files and directories currently installed.)
Removing wireshark (2.0.2+ga16e22e-1) ...
7Progress: [  0%] 
[...............................................................................................]
 87Progress: [ 25%] 
[########################.......................................................................]
 87Progress: [ 50%] 
[################################################...............................................]
 87Progress: [ 75%] 
[########################################################################.......................]
 8
78
```

This is due in part to the PackageManagerFancy::DrawStatusLine()
function in apt-pkg/install-progress.cc.

Note that Emacs can process and display typical SGR ANSI escapes (in the
form [<number>m; but not the more complex cursor manipulation commands.


```
$ apt policy apt
apt:
  Installed: 1.2.12~ubuntu16.04.1
  Candidate: 1.2.12~ubuntu16.04.1
  Version table:
 *** 1.2.12~ubuntu16.04.1 500
        500 http://archive.ubuntu.com/ubuntu xenial-updates/main amd64 Packages
        100 /var/lib/dpkg/status
     1.2.10ubuntu1 500
        500 http://archive.ubuntu.com/ubuntu xenial/main amd64 Packages
```

** Affects: apt (Ubuntu)
     Importance: Undecided
         Status: New

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/1606270

Title:
  "apt" command line tool does not correctly check for terminal
  capabilities

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/apt/+bug/1606270/+subscriptions

-- 
ubuntu-bugs mailing list
[email protected]
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

Reply via email to