procps-ng-top 默认添加了现代 UI, 想模仿 htop 但是做的和屎一样, 还导致一堆问题

调查

大多数发行版在编译 procps-ng-top 时会默认加上 --disable-modern-top, 详见 Debian Changelog

解决方法

创建 /root/.toprc 并填写以下内容

top's Config File (Linux processes with windows)
Id:k, Mode_altscr=0, Mode_irixps=1, Delay_time=1.500, Curwin=0
Def    fieldscur=  75   76  150   81  103  105  119  123  128  111  117  115  106  108  137  140  139   78   82   84 
            86   88   90   92   94   96   98  100  112  120  124  126  130  132  134  142  144  146  148  152 
           154  156  158  160  162  164  166  168  170  172  174  176  178  180  182  184  186  188  190  192 
           194  196  198  200  202  204  206  208  210  212  214  216  218  220  222  224  226  228  230  232 
           234  236  238  240  242  244  246  248  250  252  254  256  258  260  262  264  266  268  270  272 
    winflags=192948, sortindx=18, maxtasks=0, graph_cpus=0, graph_mems=0, double_up=0, combine_cpus=0, core_types=0
    summclr=1, msgsclr=1, headclr=3, taskclr=1
Job    fieldscur=  75   77  115  111  117   80  103  105  137  119  123  128  120   79  139   82   84   86   88   90 
            92   94   96   98  100  106  108  112  124  126  130  132  134  140  142  144  146  148  150  152 
           154  156  158  160  162  164  166  168  170  172  174  176  178  180  182  184  186  188  190  192 
           194  196  198  200  202  204  206  208  210  212  214  216  218  220  222  224  226  228  230  232 
           234  236  238  240  242  244  246  248  250  252  254  256  258  260  262  264  266  268  270  272 
    winflags=163252, sortindx=0, maxtasks=0, graph_cpus=2, graph_mems=0, double_up=0, combine_cpus=0, core_types=0
    summclr=6, msgsclr=6, headclr=7, taskclr=6
Mem    fieldscur=  75  117  119  120  123  125  127  129  131  154  132  156  135  136  102  104  111  139   76   78 
            80   82   84   86   88   90   92   94   96   98  100  106  108  112  114  140  142  144  146  148 
           150  152  158  160  162  164  166  168  170  172  174  176  178  180  182  184  186  188  190  192 
           194  196  198  200  202  204  206  208  210  212  214  216  218  220  222  224  226  228  230  232 
           234  236  238  240  242  244  246  248  250  252  254  256  258  260  262  264  266  268  270  272 
    winflags=163252, sortindx=21, maxtasks=0, graph_cpus=2, graph_mems=0, double_up=0, combine_cpus=0, core_types=0
    summclr=5, msgsclr=5, headclr=4, taskclr=5
Usr    fieldscur=  75   77   79   81   85   97  115  111  117  137  139   82   86   88   90   92   94   98  100  102 
           104  106  108  112  118  120  122  124  126  128  130  132  134  140  142  144  146  148  150  152 
           154  156  158  160  162  164  166  168  170  172  174  176  178  180  182  184  186  188  190  192 
           194  196  198  200  202  204  206  208  210  212  214  216  218  220  222  224  226  228  230  232 
           234  236  238  240  242  244  246  248  250  252  254  256  258  260  262  264  266  268  270  272 
    winflags=163252, sortindx=3, maxtasks=0, graph_cpus=2, graph_mems=0, double_up=0, combine_cpus=0, core_types=0
    summclr=3, msgsclr=3, headclr=2, taskclr=3
Fixed_widest=0, Summ_mscale=1, Task_mscale=0, Zero_suppress=0, Tics_scaled=0
最后修改:2025 年 08 月 19 日
如果觉得我的文章对你有用,请随意赞赏