top(1) - support UTF-8 display
Details
Details
You need a terminal that supports UTF-8 (for example, use Terminal of MacOS and login FreeBSD-head via ssh).
on A terminal:
% export LANG=ja_JP.UTF-8 % sh % touch 日本語のファイル % cat - 日本語のファイル
on B terminal:
% export LANG=ja_JP.UTF-8 % /usr/bin/top -a -d 1 | grep cat
result:
original top: % /usr/bin/top -a -d 1 | grep cat 9688 daichi 1 20 0 12M 2M piperd 0 0:00 0.00% grep cat 7925 daichi 1 20 0 11M 2M ttyin 1 0:00 0.00% cat - \M-f\M^W\M-%\M-f\M^\\M-,\M-h\M-*\M^^\M-c\M^A\M-.\M-c\M^C\M^U\M-c\M^B\M-!\M-c\M^B\M-$\M-c\M^C\M-+ % patched top: % top -a -d 1 -U daichi | grep cat 9692 daichi 1 20 0 12M 2M piperd 1 0:00 0.00% grep cat 7925 daichi 1 20 0 11M 2M ttyin 1 0:00 0.00% cat - 日本語のファイル %
Diff Detail
Diff Detail
- Lint
Lint Skipped - Unit
Tests Skipped
Event Timeline
Comment Actions
It is a bit late for me, so this is just an initial scan.
usr.bin/top/machine.c | ||
---|---|---|
991 | please add braces here. | |
usr.bin/top/top.c | ||
617–620 | Perhaps use strstr and remove the magic number 5 ? | |
usr.bin/top/top.h | ||
40 | this should be a boolean | |
usr.bin/top/utils.c | ||
338 | This feels like it should be in a library, not in top(1) | |
356–358 | this feels like a lot of duplication that could be mostly replaced by an if statement. Where did all of this come from? |
usr.bin/top/display.c | ||
---|---|---|
1273 | Please move this, and all other else statements to be on the same line as the previous enclosing brace if (foo) { |