Skip to content

Commit 4aaee89

Browse files
fix: use the correct value in termsize tuple (vercel#3458)
In vercel#3371, I messed up and used the number of rows instead of the number of columns as the width of the terminal. We now don't require a very tall terminal to print out the full update message: ![Screen Shot 2023-01-24 at 11 51 54 AM](https://user-images.githubusercontent.com/4131117/214395125-2ef19b3c-92af-4688-a92a-1f07f8202a7c.png)
1 parent 59c54dc commit 4aaee89

File tree

1 file changed

+4
-4
lines changed
  • crates/turbo-updater/src/ui

1 file changed

+4
-4
lines changed

crates/turbo-updater/src/ui/mod.rs

+4-4
Original file line numberDiff line numberDiff line change
@@ -35,12 +35,12 @@ pub fn message(text: &str) -> Result<(), UpdateNotifierError> {
3535
};
3636

3737
// render differently depending on viewport
38-
if let Some((term_width, _)) = size {
38+
if let Some((_, num_cols)) = size {
3939
// if possible, pad this value slightly
40-
let term_width = if term_width > 2 {
41-
usize::from(term_width) - 2
40+
let term_width = if num_cols > 2 {
41+
usize::from(num_cols) - 2
4242
} else {
43-
term_width.into()
43+
num_cols.into()
4444
};
4545

4646
let can_fit_box = term_width >= full_message_width;

0 commit comments

Comments
 (0)