The manual page states the following in the INTERACTIVE MODE section: --- These commands are currently recognized (^L refers to control-L): ^L Redraw the screen. --- I don't think this is correct. When I attempt control + L the program responds with an unrecognized command message. Reading through the source and the help within the program, it appears that ^L was replaced with SPC at some point in the past. If this is the case, the man page could be updated like so: --- These commands are currently recognized: SPC Redraw the screen. ---
Created attachment 255222 [details] Change the man page to show SPC as the refresh key rather than ^L This is a diff created of the change to the top.1 file to replace ^L with SPC and remove references to ^L.
Confirmed. Having trouble finding the specific commit though.
(In reply to Wes from comment #1) Please write something like "(space bar)". The string "SPC" appears to be an acronym, i.e. three words beginning with the letters S, P, and C respectively. This is very confusing. (And I know `top(1)`'s online help (key `h` or `?`) shows "SPC", too.) (In reply to Alexander Ziaee from comment #2) Commit c8aa5e526fc02c360b09718a7dcb5db1876dca05 removes the mapping of `\f` (form feed) to `CMD_redraw` (see `command_chars`). Commit b26cf3d06cf3eb014c93aef569748e60feae1911 does not associate any char with `CMD_redraw` (in `all_commands`). Eventually commit c8aa5e526fc02c360b09718a7dcb5db1876dca05 introduces the line `{' ', "update the display", false, CMD_update},` but this is actually the update command. If I do something like `printf '\f' > /dev/ttyv1` (where `ttyv1` runs an instance of `top(1)`) I do not observe any change (except the cursor moving one box down till the next refresh).
Created attachment 257972 [details] patch to top.1 ^Triage: rebase patch.
May I commit this?
As noted above by Kai, "space" doesn't redraw the screen, it just does an update. If from another window you write loads of text into the window running "top" then the corruptions will stay there even if you press "space". Again, as with Kai, I dislike the use of "SPC"
Ok, ascii(7) actually calls it SP, but I think I'm going to call it `space`. Objections?
I am now convinced of the need to put ASCII(7) in intro(5).
I wrote a patch, please review. https://reviews.freebsd.org/D49462
(In reply to Alexander Ziaee from comment #7) Looks good to me. As for ascii(7), that's a man page I used to find very useful in the past, so I think any in-context mentions of it would be handy. I can't comment on intro(5) one way or the other, but I note it's very sparse!
(In reply to Jamie Landeg-Jones from comment #10) I have it rendered in PDF and a link to the review on https://people.freebsd.org/~ziaee
A commit in branch main references this bug: URL: https://cgit.FreeBSD.org/src/commit/?id=0a85254d5a33800600477ce57fbaab64591aa6ea commit 0a85254d5a33800600477ce57fbaab64591aa6ea Author: Alexander Ziaee <ziaee@FreeBSD.org> AuthorDate: 2025-03-23 18:28:53 +0000 Commit: Alexander Ziaee <ziaee@FreeBSD.org> CommitDate: 2025-03-25 21:51:08 +0000 top: Polish key bindings in usage and manual Organize key bindings by ascii(7) for consistency and maintainability, mark them as Interactive Commands, wordsmith them, and sync their organization between the manual and help screen. MFC after: 3 days PR: 282734 Fixes: c8aa5e526 (move command mapping to commands.c) Reviewed by: imp, mhorne, Jim Brown <jpb@jimby.name> Approved by: mhorne (mentor) Differential Revision: https://reviews.freebsd.org/D49462 usr.bin/top/commands.c | 26 +++---- usr.bin/top/top.1 | 183 +++++++++++++++++++++++++------------------------ 2 files changed, 105 insertions(+), 104 deletions(-)