Skip to content
This repository has been archived by the owner on Apr 23, 2024. It is now read-only.

[FIX] Fixed line rollover for small terminals #210

Merged
merged 1 commit into from
Jan 1, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions uwufetch.c
Original file line number Diff line number Diff line change
Expand Up @@ -406,15 +406,15 @@ int print_info(struct configuration* config_flags, struct info* user_info) {
#define responsively_printf(buf, format, ...) \
{ \
sprintf(buf, format, __VA_ARGS__); \
printf("%.*s\n", user_info->ws_col - 1, buf); \
printf("%.*s\n", user_info->ws_col - 4, buf); \
line_count++; \
}
#else // _WIN32
// prints without overflowing the terminal width
#define responsively_printf(buf, format, ...) \
{ \
sprintf(buf, format, __VA_ARGS__); \
printf("%.*s\n", user_info->win.ws_col - 1, buf); \
printf("%.*s\n", user_info->win.ws_col - 4, buf); \
line_count++; \
}
#endif // _WIN32
Expand Down Expand Up @@ -467,7 +467,7 @@ int print_info(struct configuration* config_flags, struct info* user_info) {
system("ls $(brew --cellar) | wc -l | awk -F' ' '{print \" \x1b[34m \x1b[0m\x1b[1mPKGS\x1b[0m \"$1 \" (brew)\"}'");
#else
if (config_flags->show_pkgs) // print pkgs
responsively_printf(print_buf, "%s%s%sPKGS %s%s%d: %s", MOVE_CURSOR, NORMAL, BOLD, NORMAL, NORMAL, user_info->pkgs, user_info->pkgman_name);
responsively_printf(print_buf, "%s%s%sPKGS %s%d: %s", MOVE_CURSOR, NORMAL, BOLD, NORMAL, user_info->pkgs, user_info->pkgman_name);
#endif
if (config_flags->show_uptime) { // print uptime
if (user_info->uptime == 0) {
Expand Down