Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

[PATCH] Increase $COLUMNS when generating long option completions



Otherwise, option descriptions can appear cropped on wide screens.
From 2075b9f42cb9f0ad3cd1ac330302208048d65a25 Mon Sep 17 00:00:00 2001
From: Marlon Richert <marlonrichert@xxxxxxxxxxxxxxxxxxxxxxxx>
Date: Sun, 1 Aug 2021 22:22:14 +0300
Subject: [PATCH] Increase $COLUMNS when generating long option completions

Otherwise, option descriptions can appear cropped on wide screens.
---
 Completion/Base/Utility/_arguments | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/Completion/Base/Utility/_arguments b/Completion/Base/Utility/_arguments
index 3f1b39304..5db3926fb 100644
--- a/Completion/Base/Utility/_arguments
+++ b/Completion/Base/Utility/_arguments
@@ -95,7 +95,9 @@ if (( long )); then
     # option up to the end.
 
    tmp=()
-   _call_program $lflag options ${~words[1]} --help 2>&1 |
+
+   # Increase $COLUMNS, so --help output won't get cropped.
+   _call_program $lflag options COLUMNS=999 ${~words[1]} --help 2>&1 |
      while IFS= read -r opt; do
      if (( ${#tmp} )); then
        # Previous line had no comment.  Is the current one suitable?
-- 
2.30.1 (Apple Git-130)



Messages sorted by: Reverse Date, Date, Thread, Author