From 8a3cc00fce44ab0486ab6cea71d26e1ed19a8ff5 Mon Sep 17 00:00:00 2001 From: Krzysztof Karas Date: Mon, 6 Sep 2021 08:54:58 +0000 Subject: [PATCH] spdk_top: change border line display in tab window Currently we use box() function to draw borders of tab windows. This may be causing jumbled display in some terminals, when displaying vertical lines inside tab window (as seen in #2053), so this patch aims to change this. Additionally changed length value of vertical line separating tab menu from data rows, to avoid going "outside" the screen. Change-Id: Ie842bb8c958a6c3aebef81e3a0e9f7b3d74dff53 Signed-off-by: Krzysztof Karas Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/9415 Tested-by: SPDK CI Jenkins Community-CI: Broadcom CI Community-CI: Mellanox Build Bot Reviewed-by: Chengqiang Meng Reviewed-by: Tomasz Zawadzki Reviewed-by: Ben Walker --- app/spdk_top/spdk_top.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/app/spdk_top/spdk_top.c b/app/spdk_top/spdk_top.c index ad48fb749..7570a9eb1 100644 --- a/app/spdk_top/spdk_top.c +++ b/app/spdk_top/spdk_top.c @@ -1071,6 +1071,7 @@ draw_tabs(enum tabs tab_index, uint8_t sort_col) WINDOW *tab = g_tabs[tab_index]; int i, j; uint16_t offset, draw_offset; + uint16_t tab_height = g_max_row - MENU_WIN_HEIGHT - TAB_WIN_HEIGHT - 3; for (i = 0; col_desc[i].name != NULL; i++) { if (col_desc[i].disabled) { @@ -1101,8 +1102,12 @@ draw_tabs(enum tabs tab_index, uint8_t sort_col) } print_max_len(tab, 2, 1, 0, ALIGN_LEFT, ""); /* Move to next line */ - whline(tab, ACS_HLINE, MAX_STRING_LEN); - box(tab, 0, 0); + whline(tab, ACS_HLINE, g_max_col - 2); + + /* Border lines */ + mvwhline(tab, 0, 1, ACS_HLINE, g_max_col - 2); + mvwhline(tab, tab_height, 1, ACS_HLINE, g_max_col - 2); + wrefresh(tab); }