Skip to content

Slash status line implementation - #25

Open
jeanbaptistelab wants to merge 3 commits into
developfrom
statusline_initial
Open

Slash status line implementation#25
jeanbaptistelab wants to merge 3 commits into
developfrom
statusline_initial

Conversation

@jeanbaptistelab

Copy link
Copy Markdown

No description provided.

edvardxyz and others added 3 commits March 27, 2026 10:23
- ioctl() calls fails due to loki logging messing with the file descriptor used in these calls
- replace use of "slash->fd_write" with "0" (stdin fd) which is unaffected
- report error back or bail out of code path when ioctl() call fails
- check for rows > 0
- push cursor position in more appropriate place
- remove unnecessary cursor position setting
@jeanbaptistelab
jeanbaptistelab requested review from edvardxyz, kivkiv12345 and troelsjessen and a lite review from Copilot August 18, 2026 11:00

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Note

Copilot was unable to run its full agentic suite in this review.

Adds a terminal statusline feature to slash, rendering persistent messages on a reserved bottom row and integrating lifecycle hooks into terminal setup/refresh/resize handling.

Changes:

  • Added a statusline module with keyed items and severity-based coloring (normal/warning/error).
  • Integrated statusline activation/deactivation into terminal configure/restore and refresh paths, plus SIGWINCH handling.
  • Updated build system to compile the new source file and exposed a public statusline API header.

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 7 comments.

Show a summary per file
File Description
src/statusline.c Implements statusline item storage and rendering with ANSI escapes and theme colors.
src/slash.c Activates a reserved bottom row via scroll region, renders statusline during refresh, and adds resize handling.
include/slash/statusline.h Adds public API for setting/removing/counting/rendering statusline items.
include/slash/slash.h Extends struct slash with statusline state and adds slash_sigwinch declaration.
meson.build Adds src/statusline.c to build sources.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread src/slash.c
Comment on lines +889 to +904
return slash_refresh(slash, printtime);
}
struct winsize ws;
if (ioctl(0, TIOCGWINSZ, &ws) == -1) {
return -1;
}
if (ws.ws_row != slash->statusline_rows) {
slash_statusline_activate(slash);
return slash_refresh(slash, printtime);
}
char pos[16];
slash_write(slash, "\0337", 2); /* DEC save cursor */
snprintf(pos, sizeof(pos), "\033[%d;1H", slash->statusline_rows);
slash_write(slash, pos, strlen(pos));
slash_statusline_render(slash);
slash_write(slash, "\0338", 2); /* DEC restore cursor */
Comment thread src/slash.c
#ifdef SLASH_HAVE_TERMIOS_H
slash->statusline_enabled = false;
struct winsize ws;
if (ioctl(0, TIOCGWINSZ, &ws) == -1)
Comment thread src/slash.c
return slash_refresh(slash, printtime);
}
struct winsize ws;
if (ioctl(0, TIOCGWINSZ, &ws) == -1) {
Comment thread src/slash.c
slash->complete_in_completion = true;

slash->statusline_enabled = false;
tcgetattr(slash->fd_read, &slash->original);
Comment thread src/slash.c
slash->complete_in_completion = true;

slash->statusline_enabled = false;
tcgetattr(slash->fd_read, &slash->original);
Comment thread src/statusline.c
Comment on lines +24 to +25
static struct slash_statusline_item items[SLASH_STATUSLINE_MAX_ITEMS];
static int item_count = 0;
* @param format Printf-style format string for the display text (rendered max 127 chars).
* @param ... Variadic arguments matching the format string.
* @return 0 on success, -1 if no space available.
* * @note This is a macro that wraps slash_statusline_set_impl to allow inline struct initialization.
@troelsjessen

Copy link
Copy Markdown

Not performing review of this.
Developed by Edvard, integrated by JB, so multiple eyes already.
We decided on including the feature, so we need it on develop so we can start using it and gain experience with the new feature.

@edvardxyz
edvardxyz requested a balanced review from Copilot August 21, 2026 07:52

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

4 participants