[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[sup-talk] [PATCH] If we have a COLUMNS environment variable, wrap to that instead of 80.



From: Anthony Martinez <pi@pihost.us>

I find that this provides a much smoother terminal experience,
especially with dumped HTML output. At least on Linux+zsh, this
environment variable is automatically updated, and if it doesn't exist,
sup will continue to happily default to 80.
---
 lib/sup/message-chunks.rb |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/lib/sup/message-chunks.rb b/lib/sup/message-chunks.rb
index 581b707..881ac4b 100644
--- a/lib/sup/message-chunks.rb
+++ b/lib/sup/message-chunks.rb
@@ -41,7 +41,7 @@ end
 
 module Redwood
 module Chunk
-  WRAP_LEN = 80 # wrap messages and text attachments at this width
+  WRAP_LEN = ENV["COLUMNS"] || 80 # wrap messages and text attachments at this width
 
   class Attachment
     HookManager.register "mime-decode", <<EOS
-- 
1.6.5

_______________________________________________
sup-talk mailing list
sup-talk@rubyforge.org
http://rubyforge.org/mailman/listinfo/sup-talk