Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Vim mode: add missing bindings #25

Closed
rien333 opened this issue Aug 29, 2020 · 7 comments
Closed

Vim mode: add missing bindings #25

rien333 opened this issue Aug 29, 2020 · 7 comments

Comments

@rien333
Copy link

rien333 commented Aug 29, 2020

Cool to see this project continue in some official form!

Previously, I had been using a patch to get vim bindings to work. There's one binding I really miss however (perhaps there are more I haven't discovered yet), namely one to move to the top and bottom of the process list with g and G respectively. Should be fairly easy to add (see also the patch I linked), though I'm not much of a programmer myself anymore.

@d3vr
Copy link

d3vr commented Sep 2, 2020

There's also Ctrl+U and Ctrl+D to scroll up/down a page, that's missing too.

@rien333
Copy link
Author

rien333 commented Sep 2, 2020

Good catch!

@magnetophon
Copy link

Is this a good place to request that hjkl work in addition to arrows, and not instead of arrows?

@rien333
Copy link
Author

rien333 commented Sep 24, 2020

@magnetophon, to be sure that the right people see your request, you should probably comment on #141. I'm really curious how the renewed vim implementation is coming along.

@rien333
Copy link
Author

rien333 commented Oct 17, 2020

Anyone that really misses the old vim mode, but also wants to use this project there is an AUR htop-vim-git package that patches this project to support vim keys (with support for arrow keys, working search, scrolling to top/bottom with g/G).

I had to modify the patch a little, but the following worked:

vim-keybindings.patch
diff --git a/Action.c b/Action.c
index 233f132..c885197 100644
--- a/Action.c
+++ b/Action.c
@@ -393,7 +393,7 @@ static Htop_Reaction actionRedraw(ATTR_UNUSED State *st) {
 }
 
 static const struct { const char* key; const char* info; } helpLeft[] = {
-   { .key = " Arrows: ", .info = "scroll process list" },
+   { .key = "   hjkl: ", .info = "scroll process list" },
    { .key = " Digits: ", .info = "incremental PID search" },
    { .key = "   F3 /: ", .info = "incremental name search" },
    { .key = "   F4 \\: ",.info = "incremental name filtering" },
@@ -414,7 +414,7 @@ static const struct { const char* key; const char* info; } helpRight[] = {
    { .key = "  Space: ", .info = "tag process" },
    { .key = "      c: ", .info = "tag process and its children" },
    { .key = "      U: ", .info = "untag all processes" },
-   { .key = "   F9 k: ", .info = "kill process/tagged processes" },
+   { .key = "   F9 x: ", .info = "kill process/tagged processes" },
    { .key = "   F7 ]: ", .info = "higher priority (root only)" },
    { .key = "   F8 [: ", .info = "lower priority (+ nice)" },
 #if (defined(HAVE_LIBHWLOC) || defined(HAVE_LINUX_AFFINITY))
@@ -422,7 +422,7 @@ static const struct { const char* key; const char* info; } helpRight[] = {
    { .key = "      i: ", .info = "set IO priority" },
-   { .key = "      l: ", .info = "list open files with lsof" },
+   { .key = "      L: ", .info = "list open files with lsof" },
    { .key = "      s: ", .info = "trace syscalls with strace" },
    { .key = "      w: ", .info = "wrap process command in multiple lines" },
    { .key = " F2 C S: ", .info = "setup" },
-   { .key = "   F1 h: ", .info = "show this help screen" },
+   { .key = "   F1 ?: ", .info = "show this help screen" },
    { .key = "  F10 q: ", .info = "quit" },   
@@ -566,6 +566,7 @@ void Action_setBindings(Htop_Action* keys) {
    keys['I'] = actionInvertSortOrder;
    keys[KEY_F(6)] = actionExpandCollapseOrSortColumn;
    keys[KEY_F(18)] = actionExpandCollapseOrSortColumn;
+   keys['o'] = actionExpandCollapseOrSortColumn;
    keys['<'] = actionSetSortColumn;
    keys[','] = actionSetSortColumn;
    keys['>'] = actionSetSortColumn;
@@ -574,7 +575,7 @@ void Action_setBindings(Htop_Action* keys) {
    keys['q'] = actionQuit;
    keys['a'] = actionSetAffinity;
    keys[KEY_F(9)] = actionKill;
-   keys['k'] = actionKill;
+   keys['x'] = actionKill;
    keys[KEY_RECLICK] = actionExpandOrCollapse;
    keys['+'] = actionExpandOrCollapse;
    keys['='] = actionExpandOrCollapse;
@@ -585,12 +586,11 @@ void Action_setBindings(Htop_Action* keys) {
    keys['S'] = actionSetup;
    keys['C'] = actionSetup;
    keys[KEY_F(2)] = actionSetup;
-   keys['l'] = actionLsof;
+   keys['L'] = actionLsof;
    keys['s'] = actionStrace;
    keys[' '] = actionTag;
    keys['\014'] = actionRedraw; // Ctrl+L
    keys[KEY_F(1)] = actionHelp;
-   keys['h'] = actionHelp;
    keys['?'] = actionHelp;
    keys['U'] = actionUntagAll;
    keys['c'] = actionTagAllChildren;
diff --git a/Panel.c b/Panel.c
index 315f388..5842cc7 100644
--- a/Panel.c
+++ b/Panel.c
@@ -318,10 +318,12 @@ bool Panel_onKey(Panel* this, int key) {
    int size = Vector_size(this->items);
    switch (key) {
    case KEY_DOWN:
+   case 'j':
    case KEY_CTRL('N'):
       this->selected++;
       break;
    case KEY_UP:
+   case 'k':
    case KEY_CTRL('P'):
       this->selected--;
       break;
@@ -336,23 +338,33 @@ bool Panel_onKey(Panel* this, int key) {
       break;
    #endif
    case KEY_LEFT:
-   case KEY_CTRL('B'):
+   case 'h':
       if (this->scrollH > 0) {
          this->scrollH -= MAXIMUM(CRT_scrollHAmount, 0);
          this->needsRedraw = true;
       }
       break;
    case KEY_RIGHT:
-   case KEY_CTRL('F'):
+   case 'l':
       this->scrollH += CRT_scrollHAmount;
       this->needsRedraw = true;
       break;
+   case KEY_CTRL('U'):
+      this->selected -= (this->h - 1) / 2;
+      this->needsRedraw = true;
+      break;
+   case KEY_CTRL('D'):
+      this->selected += (this->h - 1) / 2;
+      this->needsRedraw = true;
+      break;
    case KEY_PPAGE:
+   case KEY_CTRL('B'):
       this->selected -= (this->h - 1);
       this->scrollV = MAXIMUM(0, this->scrollV - this->h + 1);
       this->needsRedraw = true;
       break;
    case KEY_NPAGE:
+   case KEY_CTRL('F'):
       this->selected += (this->h - 1);
       this->scrollV = MAXIMUM(0, MINIMUM(Vector_size(this->items) - this->h,
                                  this->scrollV + this->h - 1));
@@ -374,9 +386,11 @@ bool Panel_onKey(Panel* this, int key) {
       break;
    }
    case KEY_HOME:
+   case 'g':
       this->selected = 0;
       break;
    case KEY_END:
+   case 'G':
       this->selected = size - 1;
       break;
    case KEY_CTRL('A'):
diff --git a/README b/README
index 67f80ef..84f90d7 100644
--- a/README
+++ b/README
@@ -17,6 +17,47 @@ The information displayed is configurable through a graphical setup and can be s
 
 Tasks related to processes (e.g. killing and renicing) can be done without entering their PIDs.
 
+Vim keybindings
+----------------
+
+These are the keybindings added in this fork of htop:
+
+```
+    g        to the top (gg in vim)
+
+  <C-b>      up 1 page
+
+  <C-u>      up 1/2 page
+
+    k
+
+h       l    one character
+
+    j
+
+  <C-d>      down 1/2 page
+
+  <C-f>      down 1 page
+
+    G        to the end
+
+--------------------------------------------------
+
+    o        Expand/collapse (like in NERDTree)
+```
+
+In order to accomodate these keybindings, the following changes
+were made to the original keybindings:
+
+* Ctrl+F and Ctrt+B can no longer be used to navigate horizontally
+* 'h' can no longer be used to access the help, leaving Ctrl+F1 & '?'
+* 'k' can no longer be used to kill processes, being replaced with 'x'
+* 'l' can no longer be used to list open files, being replaced with 'L'
+
+
+Comparison between `htop` and classic `top`
+-------------------------------------------
+
 Running `htop` requires `ncurses` libraries (typically named libncursesw*).
 
 For more information and details on how to contribute to `htop` visit [htop.dev](https://htop.dev).
diff --git a/ScreenManager.c b/ScreenManager.c
index 2a2cb1d..705ae17 100644
--- a/ScreenManager.c
+++ b/ScreenManager.c
@@ -250,7 +250,7 @@ void ScreenManager_run(ScreenManager* this, Panel** lastFocus, int* lastKey) {
          continue;
       }
       case KEY_LEFT:
-      case KEY_CTRL('B'):
+      case 'h':
          if (this->panelCount < 2) {
             goto defaultHandler;
          }
@@ -264,7 +264,7 @@ void ScreenManager_run(ScreenManager* this, Panel** lastFocus, int* lastKey) {
             goto tryLeft;
          break;
       case KEY_RIGHT:
-      case KEY_CTRL('F'):
+      case 'l':
       case 9:
          if (this->panelCount < 2) {
             goto defaultHandler;

@rien333
Copy link
Author

rien333 commented Jan 31, 2021

Duplicate of this more general issue: #506

@rien333 rien333 closed this as completed Jan 31, 2021
@rien333
Copy link
Author

rien333 commented Jan 31, 2021

Nvm, that issue is for binding just one key to execute an arbitrary command.

cgzones added a commit to cgzones/htop that referenced this issue Jun 21, 2022
ProcessList.c:242:36: runtime error: left shift of 1 by 31 places cannot be represented in type 'int'
    #0 0x561cfec000a8 in ProcessList_buildTreeBranch ProcessList.c:242:36
    #1 0x561cfebffec2 in ProcessList_buildTreeBranch ProcessList.c:243:7
    #2 0x561cfebffec2 in ProcessList_buildTreeBranch ProcessList.c:243:7
    htop-dev#3 0x561cfebffec2 in ProcessList_buildTreeBranch ProcessList.c:243:7
    htop-dev#4 0x561cfebffec2 in ProcessList_buildTreeBranch ProcessList.c:243:7
    htop-dev#5 0x561cfebffec2 in ProcessList_buildTreeBranch ProcessList.c:243:7
    htop-dev#6 0x561cfebffec2 in ProcessList_buildTreeBranch ProcessList.c:243:7
    htop-dev#7 0x561cfebffec2 in ProcessList_buildTreeBranch ProcessList.c:243:7
    htop-dev#8 0x561cfebffec2 in ProcessList_buildTreeBranch ProcessList.c:243:7
    htop-dev#9 0x561cfebffec2 in ProcessList_buildTreeBranch ProcessList.c:243:7
    htop-dev#10 0x561cfebffec2 in ProcessList_buildTreeBranch ProcessList.c:243:7
    htop-dev#11 0x561cfebffec2 in ProcessList_buildTreeBranch ProcessList.c:243:7
    htop-dev#12 0x561cfebffec2 in ProcessList_buildTreeBranch ProcessList.c:243:7
    htop-dev#13 0x561cfebffec2 in ProcessList_buildTreeBranch ProcessList.c:243:7
    htop-dev#14 0x561cfebffec2 in ProcessList_buildTreeBranch ProcessList.c:243:7
    htop-dev#15 0x561cfebffec2 in ProcessList_buildTreeBranch ProcessList.c:243:7
    htop-dev#16 0x561cfebffec2 in ProcessList_buildTreeBranch ProcessList.c:243:7
    htop-dev#17 0x561cfebffec2 in ProcessList_buildTreeBranch ProcessList.c:243:7
    htop-dev#18 0x561cfebffec2 in ProcessList_buildTreeBranch ProcessList.c:243:7
    htop-dev#19 0x561cfebffec2 in ProcessList_buildTreeBranch ProcessList.c:243:7
    htop-dev#20 0x561cfebffec2 in ProcessList_buildTreeBranch ProcessList.c:243:7
    htop-dev#21 0x561cfebffec2 in ProcessList_buildTreeBranch ProcessList.c:243:7
    htop-dev#22 0x561cfebffec2 in ProcessList_buildTreeBranch ProcessList.c:243:7
    htop-dev#23 0x561cfebffec2 in ProcessList_buildTreeBranch ProcessList.c:243:7
    htop-dev#24 0x561cfebffec2 in ProcessList_buildTreeBranch ProcessList.c:243:7
    htop-dev#25 0x561cfebffec2 in ProcessList_buildTreeBranch ProcessList.c:243:7
    htop-dev#26 0x561cfebffec2 in ProcessList_buildTreeBranch ProcessList.c:243:7
    htop-dev#27 0x561cfebffec2 in ProcessList_buildTreeBranch ProcessList.c:243:7
    htop-dev#28 0x561cfebffec2 in ProcessList_buildTreeBranch ProcessList.c:243:7
    htop-dev#29 0x561cfebffec2 in ProcessList_buildTreeBranch ProcessList.c:243:7
    htop-dev#30 0x561cfebffec2 in ProcessList_buildTreeBranch ProcessList.c:243:7
    htop-dev#31 0x561cfebffec2 in ProcessList_buildTreeBranch ProcessList.c:243:7
    htop-dev#32 0x561cfebfb734 in ProcessList_buildTree ProcessList.c:312:10
    htop-dev#33 0x561cfebfb050 in ProcessList_updateDisplayList ProcessList.c:326:10
    htop-dev#34 0x561cfebfc58b in ProcessList_rebuildPanel ProcessList.c:374:4
    htop-dev#35 0x561cfec07953 in checkRecalculation ScreenManager.c:139:7
    htop-dev#36 0x561cfec07953 in ScreenManager_run ScreenManager.c:226:10
    htop-dev#37 0x561cfeb8899a in CommandLine_run CommandLine.c:378:4
    htop-dev#38 0x561cfeb6d6d4 in main htop.c:15:11
    htop-dev#39 0x7f14860291e9 in __libc_start_call_main csu/../sysdeps/nptl/libc_start_call_main.h:58:16
    htop-dev#40 0x7f148602929b in __libc_start_main csu/../csu/libc-start.c:392:3
    htop-dev#41 0x561cfeaafb20 in _start (htop+0x105b20) (BuildId: fc4b9e52ffc111ca8b4cd53136a238414120a858)
cgzones added a commit to cgzones/htop that referenced this issue Jun 22, 2022
ProcessList.c:242:36: runtime error: left shift of 1 by 31 places cannot be represented in type 'int'
    #0 0x561cfec000a8 in ProcessList_buildTreeBranch ProcessList.c:242:36
    #1 0x561cfebffec2 in ProcessList_buildTreeBranch ProcessList.c:243:7
    #2 0x561cfebffec2 in ProcessList_buildTreeBranch ProcessList.c:243:7
    htop-dev#3 0x561cfebffec2 in ProcessList_buildTreeBranch ProcessList.c:243:7
    htop-dev#4 0x561cfebffec2 in ProcessList_buildTreeBranch ProcessList.c:243:7
    htop-dev#5 0x561cfebffec2 in ProcessList_buildTreeBranch ProcessList.c:243:7
    htop-dev#6 0x561cfebffec2 in ProcessList_buildTreeBranch ProcessList.c:243:7
    htop-dev#7 0x561cfebffec2 in ProcessList_buildTreeBranch ProcessList.c:243:7
    htop-dev#8 0x561cfebffec2 in ProcessList_buildTreeBranch ProcessList.c:243:7
    htop-dev#9 0x561cfebffec2 in ProcessList_buildTreeBranch ProcessList.c:243:7
    htop-dev#10 0x561cfebffec2 in ProcessList_buildTreeBranch ProcessList.c:243:7
    htop-dev#11 0x561cfebffec2 in ProcessList_buildTreeBranch ProcessList.c:243:7
    htop-dev#12 0x561cfebffec2 in ProcessList_buildTreeBranch ProcessList.c:243:7
    htop-dev#13 0x561cfebffec2 in ProcessList_buildTreeBranch ProcessList.c:243:7
    htop-dev#14 0x561cfebffec2 in ProcessList_buildTreeBranch ProcessList.c:243:7
    htop-dev#15 0x561cfebffec2 in ProcessList_buildTreeBranch ProcessList.c:243:7
    htop-dev#16 0x561cfebffec2 in ProcessList_buildTreeBranch ProcessList.c:243:7
    htop-dev#17 0x561cfebffec2 in ProcessList_buildTreeBranch ProcessList.c:243:7
    htop-dev#18 0x561cfebffec2 in ProcessList_buildTreeBranch ProcessList.c:243:7
    htop-dev#19 0x561cfebffec2 in ProcessList_buildTreeBranch ProcessList.c:243:7
    htop-dev#20 0x561cfebffec2 in ProcessList_buildTreeBranch ProcessList.c:243:7
    htop-dev#21 0x561cfebffec2 in ProcessList_buildTreeBranch ProcessList.c:243:7
    htop-dev#22 0x561cfebffec2 in ProcessList_buildTreeBranch ProcessList.c:243:7
    htop-dev#23 0x561cfebffec2 in ProcessList_buildTreeBranch ProcessList.c:243:7
    htop-dev#24 0x561cfebffec2 in ProcessList_buildTreeBranch ProcessList.c:243:7
    htop-dev#25 0x561cfebffec2 in ProcessList_buildTreeBranch ProcessList.c:243:7
    htop-dev#26 0x561cfebffec2 in ProcessList_buildTreeBranch ProcessList.c:243:7
    htop-dev#27 0x561cfebffec2 in ProcessList_buildTreeBranch ProcessList.c:243:7
    htop-dev#28 0x561cfebffec2 in ProcessList_buildTreeBranch ProcessList.c:243:7
    htop-dev#29 0x561cfebffec2 in ProcessList_buildTreeBranch ProcessList.c:243:7
    htop-dev#30 0x561cfebffec2 in ProcessList_buildTreeBranch ProcessList.c:243:7
    htop-dev#31 0x561cfebffec2 in ProcessList_buildTreeBranch ProcessList.c:243:7
    htop-dev#32 0x561cfebfb734 in ProcessList_buildTree ProcessList.c:312:10
    htop-dev#33 0x561cfebfb050 in ProcessList_updateDisplayList ProcessList.c:326:10
    htop-dev#34 0x561cfebfc58b in ProcessList_rebuildPanel ProcessList.c:374:4
    htop-dev#35 0x561cfec07953 in checkRecalculation ScreenManager.c:139:7
    htop-dev#36 0x561cfec07953 in ScreenManager_run ScreenManager.c:226:10
    htop-dev#37 0x561cfeb8899a in CommandLine_run CommandLine.c:378:4
    htop-dev#38 0x561cfeb6d6d4 in main htop.c:15:11
    htop-dev#39 0x7f14860291e9 in __libc_start_call_main csu/../sysdeps/nptl/libc_start_call_main.h:58:16
    htop-dev#40 0x7f148602929b in __libc_start_main csu/../csu/libc-start.c:392:3
    htop-dev#41 0x561cfeaafb20 in _start (htop+0x105b20) (BuildId: fc4b9e52ffc111ca8b4cd53136a238414120a858)
cgzones added a commit to cgzones/htop that referenced this issue Jun 28, 2022
ProcessList.c:242:36: runtime error: left shift of 1 by 31 places cannot be represented in type 'int'
    #0 0x561cfec000a8 in ProcessList_buildTreeBranch ProcessList.c:242:36
    #1 0x561cfebffec2 in ProcessList_buildTreeBranch ProcessList.c:243:7
    #2 0x561cfebffec2 in ProcessList_buildTreeBranch ProcessList.c:243:7
    htop-dev#3 0x561cfebffec2 in ProcessList_buildTreeBranch ProcessList.c:243:7
    htop-dev#4 0x561cfebffec2 in ProcessList_buildTreeBranch ProcessList.c:243:7
    htop-dev#5 0x561cfebffec2 in ProcessList_buildTreeBranch ProcessList.c:243:7
    htop-dev#6 0x561cfebffec2 in ProcessList_buildTreeBranch ProcessList.c:243:7
    htop-dev#7 0x561cfebffec2 in ProcessList_buildTreeBranch ProcessList.c:243:7
    htop-dev#8 0x561cfebffec2 in ProcessList_buildTreeBranch ProcessList.c:243:7
    htop-dev#9 0x561cfebffec2 in ProcessList_buildTreeBranch ProcessList.c:243:7
    htop-dev#10 0x561cfebffec2 in ProcessList_buildTreeBranch ProcessList.c:243:7
    htop-dev#11 0x561cfebffec2 in ProcessList_buildTreeBranch ProcessList.c:243:7
    htop-dev#12 0x561cfebffec2 in ProcessList_buildTreeBranch ProcessList.c:243:7
    htop-dev#13 0x561cfebffec2 in ProcessList_buildTreeBranch ProcessList.c:243:7
    htop-dev#14 0x561cfebffec2 in ProcessList_buildTreeBranch ProcessList.c:243:7
    htop-dev#15 0x561cfebffec2 in ProcessList_buildTreeBranch ProcessList.c:243:7
    htop-dev#16 0x561cfebffec2 in ProcessList_buildTreeBranch ProcessList.c:243:7
    htop-dev#17 0x561cfebffec2 in ProcessList_buildTreeBranch ProcessList.c:243:7
    htop-dev#18 0x561cfebffec2 in ProcessList_buildTreeBranch ProcessList.c:243:7
    htop-dev#19 0x561cfebffec2 in ProcessList_buildTreeBranch ProcessList.c:243:7
    htop-dev#20 0x561cfebffec2 in ProcessList_buildTreeBranch ProcessList.c:243:7
    htop-dev#21 0x561cfebffec2 in ProcessList_buildTreeBranch ProcessList.c:243:7
    htop-dev#22 0x561cfebffec2 in ProcessList_buildTreeBranch ProcessList.c:243:7
    htop-dev#23 0x561cfebffec2 in ProcessList_buildTreeBranch ProcessList.c:243:7
    htop-dev#24 0x561cfebffec2 in ProcessList_buildTreeBranch ProcessList.c:243:7
    htop-dev#25 0x561cfebffec2 in ProcessList_buildTreeBranch ProcessList.c:243:7
    htop-dev#26 0x561cfebffec2 in ProcessList_buildTreeBranch ProcessList.c:243:7
    htop-dev#27 0x561cfebffec2 in ProcessList_buildTreeBranch ProcessList.c:243:7
    htop-dev#28 0x561cfebffec2 in ProcessList_buildTreeBranch ProcessList.c:243:7
    htop-dev#29 0x561cfebffec2 in ProcessList_buildTreeBranch ProcessList.c:243:7
    htop-dev#30 0x561cfebffec2 in ProcessList_buildTreeBranch ProcessList.c:243:7
    htop-dev#31 0x561cfebffec2 in ProcessList_buildTreeBranch ProcessList.c:243:7
    htop-dev#32 0x561cfebfb734 in ProcessList_buildTree ProcessList.c:312:10
    htop-dev#33 0x561cfebfb050 in ProcessList_updateDisplayList ProcessList.c:326:10
    htop-dev#34 0x561cfebfc58b in ProcessList_rebuildPanel ProcessList.c:374:4
    htop-dev#35 0x561cfec07953 in checkRecalculation ScreenManager.c:139:7
    htop-dev#36 0x561cfec07953 in ScreenManager_run ScreenManager.c:226:10
    htop-dev#37 0x561cfeb8899a in CommandLine_run CommandLine.c:378:4
    htop-dev#38 0x561cfeb6d6d4 in main htop.c:15:11
    htop-dev#39 0x7f14860291e9 in __libc_start_call_main csu/../sysdeps/nptl/libc_start_call_main.h:58:16
    htop-dev#40 0x7f148602929b in __libc_start_main csu/../csu/libc-start.c:392:3
    htop-dev#41 0x561cfeaafb20 in _start (htop+0x105b20) (BuildId: fc4b9e52ffc111ca8b4cd53136a238414120a858)
cgzones added a commit to cgzones/htop that referenced this issue Jun 28, 2022
ProcessList.c:242:36: runtime error: left shift of 1 by 31 places cannot be represented in type 'int'
    #0 0x561cfec000a8 in ProcessList_buildTreeBranch ProcessList.c:242:36
    #1 0x561cfebffec2 in ProcessList_buildTreeBranch ProcessList.c:243:7
    #2 0x561cfebffec2 in ProcessList_buildTreeBranch ProcessList.c:243:7
    htop-dev#3 0x561cfebffec2 in ProcessList_buildTreeBranch ProcessList.c:243:7
    htop-dev#4 0x561cfebffec2 in ProcessList_buildTreeBranch ProcessList.c:243:7
    htop-dev#5 0x561cfebffec2 in ProcessList_buildTreeBranch ProcessList.c:243:7
    htop-dev#6 0x561cfebffec2 in ProcessList_buildTreeBranch ProcessList.c:243:7
    htop-dev#7 0x561cfebffec2 in ProcessList_buildTreeBranch ProcessList.c:243:7
    htop-dev#8 0x561cfebffec2 in ProcessList_buildTreeBranch ProcessList.c:243:7
    htop-dev#9 0x561cfebffec2 in ProcessList_buildTreeBranch ProcessList.c:243:7
    htop-dev#10 0x561cfebffec2 in ProcessList_buildTreeBranch ProcessList.c:243:7
    htop-dev#11 0x561cfebffec2 in ProcessList_buildTreeBranch ProcessList.c:243:7
    htop-dev#12 0x561cfebffec2 in ProcessList_buildTreeBranch ProcessList.c:243:7
    htop-dev#13 0x561cfebffec2 in ProcessList_buildTreeBranch ProcessList.c:243:7
    htop-dev#14 0x561cfebffec2 in ProcessList_buildTreeBranch ProcessList.c:243:7
    htop-dev#15 0x561cfebffec2 in ProcessList_buildTreeBranch ProcessList.c:243:7
    htop-dev#16 0x561cfebffec2 in ProcessList_buildTreeBranch ProcessList.c:243:7
    htop-dev#17 0x561cfebffec2 in ProcessList_buildTreeBranch ProcessList.c:243:7
    htop-dev#18 0x561cfebffec2 in ProcessList_buildTreeBranch ProcessList.c:243:7
    htop-dev#19 0x561cfebffec2 in ProcessList_buildTreeBranch ProcessList.c:243:7
    htop-dev#20 0x561cfebffec2 in ProcessList_buildTreeBranch ProcessList.c:243:7
    htop-dev#21 0x561cfebffec2 in ProcessList_buildTreeBranch ProcessList.c:243:7
    htop-dev#22 0x561cfebffec2 in ProcessList_buildTreeBranch ProcessList.c:243:7
    htop-dev#23 0x561cfebffec2 in ProcessList_buildTreeBranch ProcessList.c:243:7
    htop-dev#24 0x561cfebffec2 in ProcessList_buildTreeBranch ProcessList.c:243:7
    htop-dev#25 0x561cfebffec2 in ProcessList_buildTreeBranch ProcessList.c:243:7
    htop-dev#26 0x561cfebffec2 in ProcessList_buildTreeBranch ProcessList.c:243:7
    htop-dev#27 0x561cfebffec2 in ProcessList_buildTreeBranch ProcessList.c:243:7
    htop-dev#28 0x561cfebffec2 in ProcessList_buildTreeBranch ProcessList.c:243:7
    htop-dev#29 0x561cfebffec2 in ProcessList_buildTreeBranch ProcessList.c:243:7
    htop-dev#30 0x561cfebffec2 in ProcessList_buildTreeBranch ProcessList.c:243:7
    htop-dev#31 0x561cfebffec2 in ProcessList_buildTreeBranch ProcessList.c:243:7
    htop-dev#32 0x561cfebfb734 in ProcessList_buildTree ProcessList.c:312:10
    htop-dev#33 0x561cfebfb050 in ProcessList_updateDisplayList ProcessList.c:326:10
    htop-dev#34 0x561cfebfc58b in ProcessList_rebuildPanel ProcessList.c:374:4
    htop-dev#35 0x561cfec07953 in checkRecalculation ScreenManager.c:139:7
    htop-dev#36 0x561cfec07953 in ScreenManager_run ScreenManager.c:226:10
    htop-dev#37 0x561cfeb8899a in CommandLine_run CommandLine.c:378:4
    htop-dev#38 0x561cfeb6d6d4 in main htop.c:15:11
    htop-dev#39 0x7f14860291e9 in __libc_start_call_main csu/../sysdeps/nptl/libc_start_call_main.h:58:16
    htop-dev#40 0x7f148602929b in __libc_start_main csu/../csu/libc-start.c:392:3
    htop-dev#41 0x561cfeaafb20 in _start (htop+0x105b20) (BuildId: fc4b9e52ffc111ca8b4cd53136a238414120a858)
cgzones added a commit to cgzones/htop that referenced this issue Jun 28, 2022
Also increase the limit for nesting by using 64 bit integers.

ProcessList.c:242:36: runtime error: left shift of 1 by 31 places cannot be represented in type 'int'
    #0 0x561cfec000a8 in ProcessList_buildTreeBranch ProcessList.c:242:36
    #1 0x561cfebffec2 in ProcessList_buildTreeBranch ProcessList.c:243:7
    #2 0x561cfebffec2 in ProcessList_buildTreeBranch ProcessList.c:243:7
    htop-dev#3 0x561cfebffec2 in ProcessList_buildTreeBranch ProcessList.c:243:7
    htop-dev#4 0x561cfebffec2 in ProcessList_buildTreeBranch ProcessList.c:243:7
    htop-dev#5 0x561cfebffec2 in ProcessList_buildTreeBranch ProcessList.c:243:7
    htop-dev#6 0x561cfebffec2 in ProcessList_buildTreeBranch ProcessList.c:243:7
    htop-dev#7 0x561cfebffec2 in ProcessList_buildTreeBranch ProcessList.c:243:7
    htop-dev#8 0x561cfebffec2 in ProcessList_buildTreeBranch ProcessList.c:243:7
    htop-dev#9 0x561cfebffec2 in ProcessList_buildTreeBranch ProcessList.c:243:7
    htop-dev#10 0x561cfebffec2 in ProcessList_buildTreeBranch ProcessList.c:243:7
    htop-dev#11 0x561cfebffec2 in ProcessList_buildTreeBranch ProcessList.c:243:7
    htop-dev#12 0x561cfebffec2 in ProcessList_buildTreeBranch ProcessList.c:243:7
    htop-dev#13 0x561cfebffec2 in ProcessList_buildTreeBranch ProcessList.c:243:7
    htop-dev#14 0x561cfebffec2 in ProcessList_buildTreeBranch ProcessList.c:243:7
    htop-dev#15 0x561cfebffec2 in ProcessList_buildTreeBranch ProcessList.c:243:7
    htop-dev#16 0x561cfebffec2 in ProcessList_buildTreeBranch ProcessList.c:243:7
    htop-dev#17 0x561cfebffec2 in ProcessList_buildTreeBranch ProcessList.c:243:7
    htop-dev#18 0x561cfebffec2 in ProcessList_buildTreeBranch ProcessList.c:243:7
    htop-dev#19 0x561cfebffec2 in ProcessList_buildTreeBranch ProcessList.c:243:7
    htop-dev#20 0x561cfebffec2 in ProcessList_buildTreeBranch ProcessList.c:243:7
    htop-dev#21 0x561cfebffec2 in ProcessList_buildTreeBranch ProcessList.c:243:7
    htop-dev#22 0x561cfebffec2 in ProcessList_buildTreeBranch ProcessList.c:243:7
    htop-dev#23 0x561cfebffec2 in ProcessList_buildTreeBranch ProcessList.c:243:7
    htop-dev#24 0x561cfebffec2 in ProcessList_buildTreeBranch ProcessList.c:243:7
    htop-dev#25 0x561cfebffec2 in ProcessList_buildTreeBranch ProcessList.c:243:7
    htop-dev#26 0x561cfebffec2 in ProcessList_buildTreeBranch ProcessList.c:243:7
    htop-dev#27 0x561cfebffec2 in ProcessList_buildTreeBranch ProcessList.c:243:7
    htop-dev#28 0x561cfebffec2 in ProcessList_buildTreeBranch ProcessList.c:243:7
    htop-dev#29 0x561cfebffec2 in ProcessList_buildTreeBranch ProcessList.c:243:7
    htop-dev#30 0x561cfebffec2 in ProcessList_buildTreeBranch ProcessList.c:243:7
    htop-dev#31 0x561cfebffec2 in ProcessList_buildTreeBranch ProcessList.c:243:7
    htop-dev#32 0x561cfebfb734 in ProcessList_buildTree ProcessList.c:312:10
    htop-dev#33 0x561cfebfb050 in ProcessList_updateDisplayList ProcessList.c:326:10
    htop-dev#34 0x561cfebfc58b in ProcessList_rebuildPanel ProcessList.c:374:4
    htop-dev#35 0x561cfec07953 in checkRecalculation ScreenManager.c:139:7
    htop-dev#36 0x561cfec07953 in ScreenManager_run ScreenManager.c:226:10
    htop-dev#37 0x561cfeb8899a in CommandLine_run CommandLine.c:378:4
    htop-dev#38 0x561cfeb6d6d4 in main htop.c:15:11
    htop-dev#39 0x7f14860291e9 in __libc_start_call_main csu/../sysdeps/nptl/libc_start_call_main.h:58:16
    htop-dev#40 0x7f148602929b in __libc_start_main csu/../csu/libc-start.c:392:3
    htop-dev#41 0x561cfeaafb20 in _start (htop+0x105b20) (BuildId: fc4b9e52ffc111ca8b4cd53136a238414120a858)
cgzones added a commit to cgzones/htop that referenced this issue Jun 28, 2022
Also increase the limit for nesting by using 64 bit integers.

ProcessList.c:242:36: runtime error: left shift of 1 by 31 places cannot be represented in type 'int'
    #0 0x561cfec000a8 in ProcessList_buildTreeBranch ProcessList.c:242:36
    #1 0x561cfebffec2 in ProcessList_buildTreeBranch ProcessList.c:243:7
    #2 0x561cfebffec2 in ProcessList_buildTreeBranch ProcessList.c:243:7
    htop-dev#3 0x561cfebffec2 in ProcessList_buildTreeBranch ProcessList.c:243:7
    htop-dev#4 0x561cfebffec2 in ProcessList_buildTreeBranch ProcessList.c:243:7
    htop-dev#5 0x561cfebffec2 in ProcessList_buildTreeBranch ProcessList.c:243:7
    htop-dev#6 0x561cfebffec2 in ProcessList_buildTreeBranch ProcessList.c:243:7
    htop-dev#7 0x561cfebffec2 in ProcessList_buildTreeBranch ProcessList.c:243:7
    htop-dev#8 0x561cfebffec2 in ProcessList_buildTreeBranch ProcessList.c:243:7
    htop-dev#9 0x561cfebffec2 in ProcessList_buildTreeBranch ProcessList.c:243:7
    htop-dev#10 0x561cfebffec2 in ProcessList_buildTreeBranch ProcessList.c:243:7
    htop-dev#11 0x561cfebffec2 in ProcessList_buildTreeBranch ProcessList.c:243:7
    htop-dev#12 0x561cfebffec2 in ProcessList_buildTreeBranch ProcessList.c:243:7
    htop-dev#13 0x561cfebffec2 in ProcessList_buildTreeBranch ProcessList.c:243:7
    htop-dev#14 0x561cfebffec2 in ProcessList_buildTreeBranch ProcessList.c:243:7
    htop-dev#15 0x561cfebffec2 in ProcessList_buildTreeBranch ProcessList.c:243:7
    htop-dev#16 0x561cfebffec2 in ProcessList_buildTreeBranch ProcessList.c:243:7
    htop-dev#17 0x561cfebffec2 in ProcessList_buildTreeBranch ProcessList.c:243:7
    htop-dev#18 0x561cfebffec2 in ProcessList_buildTreeBranch ProcessList.c:243:7
    htop-dev#19 0x561cfebffec2 in ProcessList_buildTreeBranch ProcessList.c:243:7
    htop-dev#20 0x561cfebffec2 in ProcessList_buildTreeBranch ProcessList.c:243:7
    htop-dev#21 0x561cfebffec2 in ProcessList_buildTreeBranch ProcessList.c:243:7
    htop-dev#22 0x561cfebffec2 in ProcessList_buildTreeBranch ProcessList.c:243:7
    htop-dev#23 0x561cfebffec2 in ProcessList_buildTreeBranch ProcessList.c:243:7
    htop-dev#24 0x561cfebffec2 in ProcessList_buildTreeBranch ProcessList.c:243:7
    htop-dev#25 0x561cfebffec2 in ProcessList_buildTreeBranch ProcessList.c:243:7
    htop-dev#26 0x561cfebffec2 in ProcessList_buildTreeBranch ProcessList.c:243:7
    htop-dev#27 0x561cfebffec2 in ProcessList_buildTreeBranch ProcessList.c:243:7
    htop-dev#28 0x561cfebffec2 in ProcessList_buildTreeBranch ProcessList.c:243:7
    htop-dev#29 0x561cfebffec2 in ProcessList_buildTreeBranch ProcessList.c:243:7
    htop-dev#30 0x561cfebffec2 in ProcessList_buildTreeBranch ProcessList.c:243:7
    htop-dev#31 0x561cfebffec2 in ProcessList_buildTreeBranch ProcessList.c:243:7
    htop-dev#32 0x561cfebfb734 in ProcessList_buildTree ProcessList.c:312:10
    htop-dev#33 0x561cfebfb050 in ProcessList_updateDisplayList ProcessList.c:326:10
    htop-dev#34 0x561cfebfc58b in ProcessList_rebuildPanel ProcessList.c:374:4
    htop-dev#35 0x561cfec07953 in checkRecalculation ScreenManager.c:139:7
    htop-dev#36 0x561cfec07953 in ScreenManager_run ScreenManager.c:226:10
    htop-dev#37 0x561cfeb8899a in CommandLine_run CommandLine.c:378:4
    htop-dev#38 0x561cfeb6d6d4 in main htop.c:15:11
    htop-dev#39 0x7f14860291e9 in __libc_start_call_main csu/../sysdeps/nptl/libc_start_call_main.h:58:16
    htop-dev#40 0x7f148602929b in __libc_start_main csu/../csu/libc-start.c:392:3
    htop-dev#41 0x561cfeaafb20 in _start (htop+0x105b20) (BuildId: fc4b9e52ffc111ca8b4cd53136a238414120a858)
cgzones added a commit to cgzones/htop that referenced this issue Jul 11, 2022
Also increase the limit for nesting by using 64 bit integers.

ProcessList.c:242:36: runtime error: left shift of 1 by 31 places cannot be represented in type 'int'
    #0 0x561cfec000a8 in ProcessList_buildTreeBranch ProcessList.c:242:36
    #1 0x561cfebffec2 in ProcessList_buildTreeBranch ProcessList.c:243:7
    #2 0x561cfebffec2 in ProcessList_buildTreeBranch ProcessList.c:243:7
    htop-dev#3 0x561cfebffec2 in ProcessList_buildTreeBranch ProcessList.c:243:7
    htop-dev#4 0x561cfebffec2 in ProcessList_buildTreeBranch ProcessList.c:243:7
    htop-dev#5 0x561cfebffec2 in ProcessList_buildTreeBranch ProcessList.c:243:7
    htop-dev#6 0x561cfebffec2 in ProcessList_buildTreeBranch ProcessList.c:243:7
    htop-dev#7 0x561cfebffec2 in ProcessList_buildTreeBranch ProcessList.c:243:7
    htop-dev#8 0x561cfebffec2 in ProcessList_buildTreeBranch ProcessList.c:243:7
    htop-dev#9 0x561cfebffec2 in ProcessList_buildTreeBranch ProcessList.c:243:7
    htop-dev#10 0x561cfebffec2 in ProcessList_buildTreeBranch ProcessList.c:243:7
    htop-dev#11 0x561cfebffec2 in ProcessList_buildTreeBranch ProcessList.c:243:7
    htop-dev#12 0x561cfebffec2 in ProcessList_buildTreeBranch ProcessList.c:243:7
    htop-dev#13 0x561cfebffec2 in ProcessList_buildTreeBranch ProcessList.c:243:7
    htop-dev#14 0x561cfebffec2 in ProcessList_buildTreeBranch ProcessList.c:243:7
    htop-dev#15 0x561cfebffec2 in ProcessList_buildTreeBranch ProcessList.c:243:7
    htop-dev#16 0x561cfebffec2 in ProcessList_buildTreeBranch ProcessList.c:243:7
    htop-dev#17 0x561cfebffec2 in ProcessList_buildTreeBranch ProcessList.c:243:7
    htop-dev#18 0x561cfebffec2 in ProcessList_buildTreeBranch ProcessList.c:243:7
    htop-dev#19 0x561cfebffec2 in ProcessList_buildTreeBranch ProcessList.c:243:7
    htop-dev#20 0x561cfebffec2 in ProcessList_buildTreeBranch ProcessList.c:243:7
    htop-dev#21 0x561cfebffec2 in ProcessList_buildTreeBranch ProcessList.c:243:7
    htop-dev#22 0x561cfebffec2 in ProcessList_buildTreeBranch ProcessList.c:243:7
    htop-dev#23 0x561cfebffec2 in ProcessList_buildTreeBranch ProcessList.c:243:7
    htop-dev#24 0x561cfebffec2 in ProcessList_buildTreeBranch ProcessList.c:243:7
    htop-dev#25 0x561cfebffec2 in ProcessList_buildTreeBranch ProcessList.c:243:7
    htop-dev#26 0x561cfebffec2 in ProcessList_buildTreeBranch ProcessList.c:243:7
    htop-dev#27 0x561cfebffec2 in ProcessList_buildTreeBranch ProcessList.c:243:7
    htop-dev#28 0x561cfebffec2 in ProcessList_buildTreeBranch ProcessList.c:243:7
    htop-dev#29 0x561cfebffec2 in ProcessList_buildTreeBranch ProcessList.c:243:7
    htop-dev#30 0x561cfebffec2 in ProcessList_buildTreeBranch ProcessList.c:243:7
    htop-dev#31 0x561cfebffec2 in ProcessList_buildTreeBranch ProcessList.c:243:7
    htop-dev#32 0x561cfebfb734 in ProcessList_buildTree ProcessList.c:312:10
    htop-dev#33 0x561cfebfb050 in ProcessList_updateDisplayList ProcessList.c:326:10
    htop-dev#34 0x561cfebfc58b in ProcessList_rebuildPanel ProcessList.c:374:4
    htop-dev#35 0x561cfec07953 in checkRecalculation ScreenManager.c:139:7
    htop-dev#36 0x561cfec07953 in ScreenManager_run ScreenManager.c:226:10
    htop-dev#37 0x561cfeb8899a in CommandLine_run CommandLine.c:378:4
    htop-dev#38 0x561cfeb6d6d4 in main htop.c:15:11
    htop-dev#39 0x7f14860291e9 in __libc_start_call_main csu/../sysdeps/nptl/libc_start_call_main.h:58:16
    htop-dev#40 0x7f148602929b in __libc_start_main csu/../csu/libc-start.c:392:3
    htop-dev#41 0x561cfeaafb20 in _start (htop+0x105b20) (BuildId: fc4b9e52ffc111ca8b4cd53136a238414120a858)
BenBE pushed a commit that referenced this issue Aug 4, 2022
Also increase the limit for nesting by using 64 bit integers.

ProcessList.c:242:36: runtime error: left shift of 1 by 31 places cannot be represented in type 'int'
    #0 0x561cfec000a8 in ProcessList_buildTreeBranch ProcessList.c:242:36
    #1 0x561cfebffec2 in ProcessList_buildTreeBranch ProcessList.c:243:7
    #2 0x561cfebffec2 in ProcessList_buildTreeBranch ProcessList.c:243:7
    #3 0x561cfebffec2 in ProcessList_buildTreeBranch ProcessList.c:243:7
    #4 0x561cfebffec2 in ProcessList_buildTreeBranch ProcessList.c:243:7
    #5 0x561cfebffec2 in ProcessList_buildTreeBranch ProcessList.c:243:7
    #6 0x561cfebffec2 in ProcessList_buildTreeBranch ProcessList.c:243:7
    #7 0x561cfebffec2 in ProcessList_buildTreeBranch ProcessList.c:243:7
    #8 0x561cfebffec2 in ProcessList_buildTreeBranch ProcessList.c:243:7
    #9 0x561cfebffec2 in ProcessList_buildTreeBranch ProcessList.c:243:7
    #10 0x561cfebffec2 in ProcessList_buildTreeBranch ProcessList.c:243:7
    #11 0x561cfebffec2 in ProcessList_buildTreeBranch ProcessList.c:243:7
    #12 0x561cfebffec2 in ProcessList_buildTreeBranch ProcessList.c:243:7
    #13 0x561cfebffec2 in ProcessList_buildTreeBranch ProcessList.c:243:7
    #14 0x561cfebffec2 in ProcessList_buildTreeBranch ProcessList.c:243:7
    #15 0x561cfebffec2 in ProcessList_buildTreeBranch ProcessList.c:243:7
    #16 0x561cfebffec2 in ProcessList_buildTreeBranch ProcessList.c:243:7
    #17 0x561cfebffec2 in ProcessList_buildTreeBranch ProcessList.c:243:7
    #18 0x561cfebffec2 in ProcessList_buildTreeBranch ProcessList.c:243:7
    #19 0x561cfebffec2 in ProcessList_buildTreeBranch ProcessList.c:243:7
    #20 0x561cfebffec2 in ProcessList_buildTreeBranch ProcessList.c:243:7
    #21 0x561cfebffec2 in ProcessList_buildTreeBranch ProcessList.c:243:7
    #22 0x561cfebffec2 in ProcessList_buildTreeBranch ProcessList.c:243:7
    #23 0x561cfebffec2 in ProcessList_buildTreeBranch ProcessList.c:243:7
    #24 0x561cfebffec2 in ProcessList_buildTreeBranch ProcessList.c:243:7
    #25 0x561cfebffec2 in ProcessList_buildTreeBranch ProcessList.c:243:7
    #26 0x561cfebffec2 in ProcessList_buildTreeBranch ProcessList.c:243:7
    #27 0x561cfebffec2 in ProcessList_buildTreeBranch ProcessList.c:243:7
    #28 0x561cfebffec2 in ProcessList_buildTreeBranch ProcessList.c:243:7
    #29 0x561cfebffec2 in ProcessList_buildTreeBranch ProcessList.c:243:7
    #30 0x561cfebffec2 in ProcessList_buildTreeBranch ProcessList.c:243:7
    #31 0x561cfebffec2 in ProcessList_buildTreeBranch ProcessList.c:243:7
    #32 0x561cfebfb734 in ProcessList_buildTree ProcessList.c:312:10
    #33 0x561cfebfb050 in ProcessList_updateDisplayList ProcessList.c:326:10
    #34 0x561cfebfc58b in ProcessList_rebuildPanel ProcessList.c:374:4
    #35 0x561cfec07953 in checkRecalculation ScreenManager.c:139:7
    #36 0x561cfec07953 in ScreenManager_run ScreenManager.c:226:10
    #37 0x561cfeb8899a in CommandLine_run CommandLine.c:378:4
    #38 0x561cfeb6d6d4 in main htop.c:15:11
    #39 0x7f14860291e9 in __libc_start_call_main csu/../sysdeps/nptl/libc_start_call_main.h:58:16
    #40 0x7f148602929b in __libc_start_main csu/../csu/libc-start.c:392:3
    #41 0x561cfeaafb20 in _start (htop+0x105b20) (BuildId: fc4b9e52ffc111ca8b4cd53136a238414120a858)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants