mirror of
https://github.com/xzeldon/htop.git
synced 2025-07-12 12:14:36 +03:00
limit max screen title length to window width
Applies screen title truncating to all InfoScreen classes.
This commit is contained in:
@ -45,14 +45,7 @@ static void CommandScreen_scan(InfoScreen* this) {
|
||||
}
|
||||
|
||||
static void CommandScreen_draw(InfoScreen* this) {
|
||||
char* title = xMalloc(COLS + 1);
|
||||
int len = snprintf(title, COLS + 1, "Command of process %d - %s", this->process->pid, this->process->comm);
|
||||
if (len > COLS) {
|
||||
memset(&title[COLS - 3], '.', 3);
|
||||
}
|
||||
|
||||
InfoScreen_drawTitled(this, "%s", title);
|
||||
free(title);
|
||||
InfoScreen_drawTitled(this, "Command of process %d - %s", this->process->pid, this->process->comm);
|
||||
}
|
||||
|
||||
InfoScreenClass CommandScreen_class = {
|
||||
|
Reference in New Issue
Block a user