[konsole] [Bug 470074] Tab title is incorrect, appears to incorrectly parse /proc/$PID/stat for the name of a process

Kurt Hindenburg bugzilla_noreply at kde.org
Sat Aug 12 08:04:05 BST 2023


https://bugs.kde.org/show_bug.cgi?id=470074

Kurt Hindenburg <khindenburg at kde.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|CONFIRMED                   |RESOLVED
         Resolution|---                         |FIXED
      Latest Commit|                            |https://invent.kde.org/util
                   |                            |ities/konsole/-/commit/4852
                   |                            |3348d9e1c1b2c559314c84372eb
                   |                            |e41312638

--- Comment #2 from Kurt Hindenburg <khindenburg at kde.org> ---
Git commit 48523348d9e1c1b2c559314c84372ebe41312638 by Kurt Hindenburg, on
behalf of Theodore Wang.
Committed on 12/08/2023 at 09:04.
Pushed by hindenburg into branch 'master'.

Resolve parsing issues for certain process names to fix incorrect tab titles

Valid file names for executables can contain '(', ')' or ' '.
Some odd but legal executable names include "a) (b", "(a" and "b)".
The above examples will lead to incorrect tab titles due to incorrect
parsing of the tab names.

This change finds the index of the last character of the name field by
searching for the last occurence of ')'. The search encompasses a range
of 16 characters starting from the starting index of the name field.

This change relies on the field in /proc/%pid/stat containing the name
of the process to start with '(' and ends with ')'. It also relies on
the fact that the maximum length of the name of a process is 16 characters.
Lastly, it relies on the rest of the contents of /proc/%pid/stat not
containing parentheses.

M  +8    -8    src/ProcessInfo.cpp

https://invent.kde.org/utilities/konsole/-/commit/48523348d9e1c1b2c559314c84372ebe41312638

-- 
You are receiving this mail because:
You are the assignee for the bug.


More information about the konsole-devel mailing list