Add shortcut key 'p' to toggle full program paths.

This commit is contained in:
Tobias Geerinckx-Rice 2015-07-29 21:32:36 +02:00
parent 293eec4265
commit fc0e44662c
2 changed files with 9 additions and 0 deletions

View File

@ -211,6 +211,11 @@ static Htop_Reaction actionToggleUserlandThreads(State* st) {
return HTOP_RECALCULATE | HTOP_SAVE_SETTINGS; return HTOP_RECALCULATE | HTOP_SAVE_SETTINGS;
} }
static Htop_Reaction actionToggleProgramPath(State* st) {
st->settings->showProgramPath = !st->settings->showProgramPath;
return HTOP_REFRESH | HTOP_SAVE_SETTINGS;
}
static Htop_Reaction actionToggleTreeView(State* st) { static Htop_Reaction actionToggleTreeView(State* st) {
st->settings->treeView = !st->settings->treeView; st->settings->treeView = !st->settings->treeView;
if (st->settings->treeView) st->settings->direction = 1; if (st->settings->treeView) st->settings->direction = 1;
@ -501,6 +506,7 @@ void Action_setBindings(Htop_Action* keys) {
keys['P'] = actionSortByCPU; keys['P'] = actionSortByCPU;
keys['H'] = actionToggleUserlandThreads; keys['H'] = actionToggleUserlandThreads;
keys['K'] = actionToggleKernelThreads; keys['K'] = actionToggleKernelThreads;
keys['p'] = actionToggleProgramPath;
keys['t'] = actionToggleTreeView; keys['t'] = actionToggleTreeView;
keys[KEY_F(5)] = actionToggleTreeView; keys[KEY_F(5)] = actionToggleTreeView;
keys[KEY_F(4)] = actionIncFilter; keys[KEY_F(4)] = actionIncFilter;

View File

@ -151,6 +151,9 @@ Hide user threads: on systems that represent them differently than ordinary
processes (such as recent NPTL-based systems), this can hide threads from processes (such as recent NPTL-based systems), this can hide threads from
userspace processes in the process list. (This is a toggle key.) userspace processes in the process list. (This is a toggle key.)
.TP .TP
.B p
Show full paths to running programs, where applicable. (This is a toggle key.)
.TP
.B Ctrl-L .B Ctrl-L
Refresh: redraw screen and recalculate values. Refresh: redraw screen and recalculate values.
.TP .TP