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

Re: [sup-talk] Sup-sync exception



Excerpts from rick.tessner's message of Fri Nov 06 08:13:19 -0700 2009:
> I had that exact same thing.  If you applied a patch that used
> Ncurses.cols rather than WRAP_LEN to determine screen width, you'll have
> that problem in the non-curses based sup applications.
> 
> The patch came from an email with the subject
> 
>     [PATCH] Use terminal width instead of hardcoded 80 as the wrap length.

I had applied that previous patch, as you guessed.

There was another patch that is complementary in getting the console to recognize the width of the terminal, I forget the tname, but here's what I have in my message-chunks.rb:

  TERM_WIDTH = `stty size 2>/dev/null`.split[1].to_i # to_i returns 0 if it fails
  WRAP_LEN = TERM_WIDTH > 0 && TERM_WIDTH || 80 # wrap messages and text attachments at this width

I don't know why that patch preferred `stty` to ENV["COLUMNS"], since that one had worked for me.

> I initially didn't have any problems whatsoever with that patch until I ran
> sup-sync. I fixed it with the attached commit.
> 
> This patch just does a rescue on that call.  The patch is only
> applicable if you had applied a patch that came through previously on
> this list for using Ncurses.cols rather than WRAP_LEN in
> lib/sup/message-chunks.rb

Thanks, it is much happier now.

-Mark

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