Skip to content

Commit aafefb2

Browse files
committed
Report the guessed/effective emoji width with -d2 on startup
This will print out along with the stuff we've guessed about color support. We get a lot of bug reports about these messing up rendering, this is useful diagnostic output.
1 parent 290d07a commit aafefb2

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/env.cpp

+4-1
Original file line numberDiff line numberDiff line change
@@ -566,8 +566,10 @@ static void guess_emoji_width() {
566566
if (term == L"Apple_Terminal" && version >= 400) {
567567
// Apple Terminal on High Sierra
568568
g_guessed_fish_emoji_width = 2;
569+
debug(2, "default emoji width: 2 for %ls", term.c_str());
569570
} else {
570571
g_guessed_fish_emoji_width = 1;
572+
debug(2, "default emoji width: 1");
571573
}
572574
}
573575

@@ -655,7 +657,7 @@ static void setup_path() {
655657
cspath.resize(confstr(_CS_PATH, nullptr, 0));
656658
confstr(_CS_PATH, &cspath[0], cspath.length());
657659
#else
658-
std::string cspath = "/bin:/usr/bin"; // shouldn't really happen
660+
std::string cspath = "/bin:/usr/bin"; // I doubt this is even necessary
659661
#endif
660662
vars.set_one(L"PATH", ENV_GLOBAL | ENV_EXPORT, str2wcstring(cspath));
661663
}
@@ -784,6 +786,7 @@ static void handle_change_emoji_width(const wcstring &op, const wcstring &var_na
784786
new_width = fish_wcstol(width_str->as_string().c_str());
785787
}
786788
g_fish_emoji_width = std::max(0, new_width);
789+
debug(2, "'fish_emoji_width' preference: %d, overwriting default", g_fish_emoji_width);
787790
}
788791

789792
static void handle_change_ambiguous_width(const wcstring &op, const wcstring &var_name,

0 commit comments

Comments
 (0)