From 89db9e0ff061279c585254c9165bfbbd7adccdc1 Mon Sep 17 00:00:00 2001 From: Stu Franks Date: Fri, 6 Oct 2023 10:51:03 +0100 Subject: [PATCH] Fix multiline prompt word wrapping and scrollback issues --- lib/tty/reader/line.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/tty/reader/line.rb b/lib/tty/reader/line.rb index fb2bc57..490fadd 100644 --- a/lib/tty/reader/line.rb +++ b/lib/tty/reader/line.rb @@ -75,7 +75,7 @@ def prompt_display_width # return the length of each line + screen width for every line # past the first which accounts for multi-line prompts - lines.join.length + ((lines.length - 1) * TTY::Screen.width) + lines.last.length + ((lines.length - 1) * TTY::Screen.width) end # Check if line is in edit mode