"apt" command line tool does not correctly check for terminal capabilities
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
apt (Ubuntu) |
Confirmed
|
Undecided
|
Unassigned |
Bug Description
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%] [......
7[0;30r8[1A[J
```
This is due in part to the PackageManagerF
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~
Candidate: 1.2.12~
Version table:
*** 1.2.12~
500 http://
100 /var/lib/
1.2.10ubuntu1 500
500 http://
```
Status changed to 'Confirmed' because the bug affects multiple users.