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

Commit

Permalink
Merge pull request #210 from buzzqrd/main
Browse files Browse the repository at this point in the history
[FIX] Fixed line rollover for small terminals
  • Loading branch information
ad-oliviero authored Jan 1, 2023
2 parents 1aa771f + 4718d6d commit 8508f38
Showing 1 changed file with 3 additions and 3 deletions.
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

0 comments on commit 8508f38

Please sign in to comment.