Commit 15692a2
committed
flux-top: fix formatting with ASCII jobids
Problem: When jobids are being encoded with ascii 'f', jobs in
the flux-top(1) joblist pane are not aligned with the header row.
This occurs because mvwprintw(3) doesn't seem to handle multibyte
UTF-8 characters properly. (This appears to be why the JOBID column
is formatted with %12s while the jobs are formatted with %13.13s
currently).
Detect whether ascii 'f' is being used in jobids by testing the result
of strlen(3) for jobid 0 encoded as f58. If the result is 2 then
ascii jobids are being used, so use 13 for the JOBID column width,
otherwise the multibyte 'ƒ' is most likely being used so use 12 for
the JOBID width.1 parent c759f12 commit 15692a2
1 file changed
+24
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
27 | 27 | | |
28 | 28 | | |
29 | 29 | | |
| 30 | + | |
30 | 31 | | |
31 | 32 | | |
32 | 33 | | |
| |||
85 | 86 | | |
86 | 87 | | |
87 | 88 | | |
88 | | - | |
| 89 | + | |
| 90 | + | |
89 | 91 | | |
90 | 92 | | |
91 | 93 | | |
92 | 94 | | |
93 | 95 | | |
94 | 96 | | |
95 | 97 | | |
96 | | - | |
| 98 | + | |
| 99 | + | |
97 | 100 | | |
98 | 101 | | |
99 | 102 | | |
| |||
413 | 416 | | |
414 | 417 | | |
415 | 418 | | |
| 419 | + | |
| 420 | + | |
| 421 | + | |
| 422 | + | |
| 423 | + | |
| 424 | + | |
| 425 | + | |
| 426 | + | |
| 427 | + | |
| 428 | + | |
| 429 | + | |
| 430 | + | |
| 431 | + | |
| 432 | + | |
| 433 | + | |
| 434 | + | |
| 435 | + | |
| 436 | + | |
416 | 437 | | |
417 | 438 | | |
418 | 439 | | |
| |||
422 | 443 | | |
423 | 444 | | |
424 | 445 | | |
| 446 | + | |
425 | 447 | | |
426 | 448 | | |
427 | 449 | | |
| |||
0 commit comments