Bug#898603: dpkg: Terminal width detection can make output of 'dpkg -l' useless
Hi! On Sun, 2018-05-13 at 21:29:13 -0700, Dima Kogan wrote: > Package: dpkg > Currently dpkg has logic to detect the terminal width and then to adjust > its output. If the terminal is too narrow this has the effect of > truncating useful information such as the package names and versions. > Truncating this information has the effect of rendering the output > useless. For instance: […] > I asked dpkg to tell me about all the '*sundials*' packages it knows > about. And it then lied to me about both the names and the versions of > these packages. To get the requested information out I have to prevent > dpkg from knowing my terminal settings: I think if dpkg had a say, it would reject the notion that it lied to you, it just provided partial information. ;) […] > Can we please strip out this logic? I don't think 'dpkg -l' should cut > out any information ever. Want a patch? So, I'm usually annoyed by this behavior to the point that I tend to use a pager to get the output. But this is a historical behavior and I'm not sure whether people would get annoyed by such change, people are sensitive like that to this kind of UI change. I think a compromise change might be to automatically run the output through a pager when on a terminal, then the trimming code can go. I will probably ask around to see what people say. Thanks, Guillem
Bug#898603: dpkg: Terminal width detection can make output of 'dpkg -l' useless
Guillem Jover writes: > I think a compromise change might be to automatically run the output > through a pager when on a terminal, then the trimming code can go. I > will probably ask around to see what people say. Thanks for responding. This is a really pernicious issue, so PLEASE try to get this resolved. For YOU, you know to 'dpkg -l | cat' to get the correct behavior. For OTHERS, people simply have no known way to answer the question 'what version of package X do I have installed?'. This is not a good state of affairs. dima
Bug#898603: dpkg: Terminal width detection can make output of 'dpkg -l' useless
Package: dpkg Hi. Currently dpkg has logic to detect the terminal width and then to adjust its output. If the terminal is too narrow this has the effect of truncating useful information such as the package names and versions. Truncating this information has the effect of rendering the output useless. For instance: dima@scrawny:~$ echo $COLUMNS 88 dima@scrawny:~$ dpkg -l '*sundials*' Desired=Unknown/Install/Remove/Purge/Hold | Status=Not/Inst/Conf-files/Unpacked/halF-conf/Half-inst/trig-aWait/Trig-pend |/ Err?=(none)/Reinst-required (Status,Err: uppercase=bad) ||/ Name Version Architecture Description +++--=-=-= ii libsundials-arko 2.7.0+dfsg-2+ amd64 differential equation solver (SUNDIAL ii libsundials-cvod 2.7.0+dfsg-2+ amd64 ordinary differential equation solver ii libsundials-cvod 2.7.0+dfsg-2+ amd64 ODE solver with sensistivity analysis ii libsundials-dev 2.7.0+dfsg-2+ amd64 Package providing everything for SUND ii libsundials-ida2 2.7.0+dfsg-2+ amd64 differential-algebraic system solver ii libsundials-idas 2.7.0+dfsg-2+ amd64 IDA solver with sensitivity capabilit ii libsundials-kins 2.7.0+dfsg-2+ amd64 KINSOL solver (SUNDIALS library) ii libsundials-nvec 2.7.0+dfsg-2+ amd64 HYPRE vector operations library (SUND ii libsundials-nvec 2.7.0+dfsg-2+ amd64 MPI vector operations library (SUNDIA ii libsundials-nvec 2.7.0+dfsg-2+ amd64 OpenMP vector operations library (SUN ii libsundials-nvec 2.7.0+dfsg-2+ amd64 PETSc vector operations library (SUND ii libsundials-nvec 2.7.0+dfsg-2+ amd64 Pthread vector operations library (SU ii libsundials-nvec 2.7.0+dfsg-2+ amd64 Non-parallel vector operations librar un libsundials-seri (no description available) I asked dpkg to tell me about all the '*sundials*' packages it knows about. And it then lied to me about both the names and the versions of these packages. To get the requested information out I have to prevent dpkg from knowing my terminal settings: dima@scrawny:~$ dpkg -l '*sundials*' | cat Desired=Unknown/Install/Remove/Purge/Hold | Status=Not/Inst/Conf-files/Unpacked/halF-conf/Half-inst/trig-aWait/Trig-pend |/ Err?=(none)/Reinst-required (Status,Err: uppercase=bad) ||/ NameVersion Architecture Description +++-===-===--=== ii libsundials-arkode1:amd64 2.7.0+dfsg-2+b2 amd64 differential equation solver (SUNDIALS library) ii libsundials-cvode2:amd642.7.0+dfsg-2+b2 amd64 ordinary differential equation solver (SUNDIALS library) ii libsundials-cvodes2:amd64 2.7.0+dfsg-2+b2 amd64ODE solver with sensistivity analysis (SUNDIALS library) ii libsundials-dev 2.7.0+dfsg-2+b2 amd64 Package providing everything for SUNDIALS dev work ii libsundials-ida2:amd64 2.7.0+dfsg-2+b2 amd64 differential-algebraic system solver (SUNDIALS library) ii libsundials-idas1:amd64 2.7.0+dfsg-2+b2 amd64IDA solver with sensitivity capabilities (SUNDIALS library) ii libsundials-kinsol2:amd64 2.7.0+dfsg-2+b2 amd64 KINSOL solver (SUNDIALS library) ii libsundials-nvecparallel-hypre2:amd64 2.7.0+dfsg-2+b2 amd64 HYPRE vector operations library (SUNDIALS library) ii libsundials-nvecparallel-mpi2:amd64 2.7.0+dfsg-2+b2 amd64MPI vector operations library (SUNDIALS library) ii libsundials-nvecparallel-openmp2:amd64 2.7.0+dfsg-2+b2 amd64 OpenMP vector operations library (SUNDIALS library) ii libsundials-nvecparallel-petsc2:amd64 2.7.0+dfsg-2+b2 amd64 PETSc vector operations library (SUNDIALS library) ii libsundials-nvecparallel-pthread2:amd64 2.7.0+dfsg-2+b2 amd64 Pthread vector operations library (SUNDIALS library) ii libsundials-nvecserial2:amd64 2.7.0+dfsg-2+b2 amd64 Non-parallel vector operations library (SUNDIALS library) un libsundials-serial-dev (no description available) Can we please strip out this logic? I don't think 'dpkg -l' should cut out any information ever. Want a patch?