diff --git a/CHANGELOG.md b/CHANGELOG.md index a600032f7..8b6afb140 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,7 @@ # fish 2.7b1 ## Notable fixes and improvements +- The `COLUMNS` and `LINES` env vars are now correctly set the first time `fish_prompt` is run (#4141). ## Other significant changes diff --git a/src/reader.cpp b/src/reader.cpp index 4a0e67c7b..bbd43b0ba 100644 --- a/src/reader.cpp +++ b/src/reader.cpp @@ -800,6 +800,10 @@ void reader_init() { if (is_interactive_session) { tcsetattr(STDIN_FILENO, TCSANOW, &shell_modes); } + + // We do this not because we actually need the window size but for its side-effect of correctly + // setting the COLUMNS and LINES env vars. + get_current_winsize(); } void reader_destroy() { pthread_key_delete(generation_count_key); }