Add N/C/M direct sort keys; dockertop 1.1.0

This commit is contained in:
Andy Dixon
2026-10-07 14:12:56 +01:00
parent 25dd8505a0
commit 8b158b1b66
4 changed files with 22 additions and 2 deletions
+5
View File
@@ -1,5 +1,10 @@
# Changelog
## 1.1.0 — 2026-10-07
- `N`, `C` and `M` sort directly by name, CPU or memory (command, CPU or
memory in the process view); `s` still cycles.
## 1.0.0 — 2026-10-07
First release.
+1 -1
View File
@@ -21,7 +21,7 @@ pids limit, I/O rates and uptime.
ports, mounts, labels; environment hidden until you press `e`) and `l` follows
the logs. Actions, each confirmed first: stop/start (`x`), restart (`r`),
pause/unpause (`p`) and send a signal (`k`), to the container or, in the
process view, to the selected process. Search (`/`), sort (`s`), show stopped
process view, to the selected process. Search (`/`), sort (`s` to cycle, `N`/`C`/`M` for name, CPU, memory), show stopped
(`a`), command line (`c`), help (`h`). Settings persist in
`~/.config/dockertop/config`. See `man dockertop`.
+3
View File
@@ -189,6 +189,9 @@ Incremental search: over name, ID, image, compose project and status in
the list; over command line, name, user and PID in the process view.
\fBEnter\fR keeps the filter, \fBEsc\fR clears it.
.TP
.B N, C, M
Sort by name (command in the process view), CPU or memory.
.TP
.B s
Cycle the sort column. The process view sorts by
.BR CPU ,
+13 -1
View File
@@ -799,6 +799,18 @@ func (a *app) rune(r rune) (quit bool) {
a.sortBy = (a.sortBy + 1) % len(sortNames)
a.rebuild()
}
case 'N', 'C', 'M':
name := map[rune]string{'N': "NAME", 'C': "CPU", 'M': "MEM"}[r]
if a.view == viewProcs {
if name == "NAME" {
name = "COMMAND"
}
a.psortBy = indexOf(psortNames, name)
a.rebuildProcs()
} else {
a.sortBy = indexOf(sortNames, name)
a.rebuild()
}
case 't':
if a.view == viewProcs {
a.ptree = !a.ptree
@@ -1388,7 +1400,7 @@ func (a *app) drawHelp() {
"",
"Keys",
" Up/Down PgUp/PgDn Home/End move Enter processes d details (e: environment) l logs (Left/Right scroll)",
" / search s sort t tree a show stopped containers c command line h help q quit / back",
" / search s cycle sort N/C/M sort by name/CPU/memory t tree a show stopped containers c command line h help q quit / back",
"",
"Settings (sorts, trees, a, c, refresh) are saved to " + configPath() + " on exit.",
"Needs access to the Docker socket (docker group or root). Signalling processes and container user names need root.",