Giorgio Lando
2008-Jan-05 12:58 UTC
[sup-talk] interface blinking and corrupted on the console
Hi, yet another issue. When I run sup on the plain console or on the framebuffer, it starts to beep and continues forever; everything blinks; keybindings seem to work (or at least I am able to get out with q). This does not happen in X; also if I run sup into a screen session on the onsole everything works fine. Looking at my environment variables, the only thing which seems to distinguish the plain console from screen on the console is the TERM variable, which on the console is set to "linux". I have no similar issues with other ncurses apps on the console. Should I set TERM to something else? Giorgio Lando
William Morgan
2008-Jan-05 18:33 UTC
[sup-talk] interface blinking and corrupted on the console
Excerpts from Giorgio Lando''s message of Sat Jan 05 04:58:50 -0800 2008:> Hi, yet another issue. When I run sup on the plain console or on the > framebuffer, it starts to beep and continues forever; everything > blinks; keybindings seem to work (or at least I am able to get out with > q).I believe this is because of the way we''re trying to set the X window title. This patch should help temporarily: --- cut here --- diff --git a/lib/sup/buffer.rb b/lib/sup/buffer.rb index fa1afe6..7f0ad81 100644 --- a/lib/sup/buffer.rb +++ b/lib/sup/buffer.rb @@ -262,7 +262,7 @@ EOS get_status_and_title @focus_buf # must be called outside of the ncurses end - print "\033]2;#{title}\07" if title + #print "\033]2;#{title}\07" if title Ncurses.mutex.lock unless opts[:sync] == false --- cut here ---> This does not happen in X; also if I run sup into a screen session on > the onsole everything works fine. Looking at my environment variables, > the only thing which seems to distinguish the plain console from > screen on the console is the TERM variable, which on the console is > set to "linux". I have no similar issues with other ncurses apps on > the console.Does anyone know what the correct approach is for determining whether to set the title or not? Is it a matter of checking $TERM? -- William <wmorgan-sup at masanjin.net>
Marcus Williams
2008-Jan-05 20:11 UTC
[sup-talk] interface blinking and corrupted on the console
On 5.1.2008, William Morgan wrote:> Does anyone know what the correct approach is for determining whether to > set the title or not? Is it a matter of checking $TERM?I think checking if $TERM is one of "xterm.*" and "rxvt.*". I''d also add "screen" to the list as well (because screen deals with it and my main usage of sup is during a screen session :) and maybe "cyg.*" for whatever the cygwin term variable is (I think its cygwin but might be cygterm cant remember). Needs to be a regex because you get stuff like xterm-color. Marcus
Giorgio Lando
2008-Jan-05 21:32 UTC
[sup-talk] interface blinking and corrupted on the console
> I believe this is because of the way we''re trying to set the X window > title. This patch should help temporarily: > > --- cut here --- > diff --git a/lib/sup/buffer.rb b/lib/sup/buffer.rb > index fa1afe6..7f0ad81 100644 > --- a/lib/sup/buffer.rb > +++ b/lib/sup/buffer.rb > @@ -262,7 +262,7 @@ EOS > get_status_and_title @focus_buf # must be called outside of the ncurses > end > > - print "\033]2;#{title}\07" if title > + #print "\033]2;#{title}\07" if title > > Ncurses.mutex.lock unless opts[:sync] == falseYes, the patch fixes the issue.> > Does anyone know what the correct approach is for determining whether to > set the title or not? Is it a matter of checking $TERM? >It seems so, set title works fine both in *rxvt and screen for me, except for the fact that the title in screen persists after I quit sup; but this may be also seen as the correct behaviour. Giorgio
Marcus Williams
2008-Jan-05 22:01 UTC
[sup-talk] interface blinking and corrupted on the console
On 5.1.2008, Giorgio Lando wrote:> It seems so, set title works fine both in *rxvt and screen for me, > except for the fact that the title in screen persists after I quit sup; > but this may be also seen as the correct behaviour.I''d probably agree this is correct behaviour - vim does the same thing. I run my xterms with a title set in the bash prompt (so I get current host/user/directory in the xterm) so when I drop out of sup it changes to the bash set title. Marcus
Giorgio Lando
2008-Jan-06 22:54 UTC
[sup-talk] interface blinking and corrupted on the console
Excerpts from William Morgan''s message of Sat Jan 05 19:33:14 +0100 2008:> > I believe this is because of the way we''re trying to set the X window > title. This patch should help temporarily: > > --- cut here --- > diff --git a/lib/sup/buffer.rb b/lib/sup/buffer.rb > index fa1afe6..7f0ad81 100644 > --- a/lib/sup/buffer.rb > +++ b/lib/sup/buffer.rb > @@ -262,7 +262,7 @@ EOS > get_status_and_title @focus_buf # must be called outside of the ncurses > end > > - print "\033]2;#{title}\07" if title > + #print "\033]2;#{title}\07" if title > > Ncurses.mutex.lock unless opts[:sync] == false >Yes I confirm that this is the cause of blinking & corruption in the plain console, since the patch blocks this behaviour. Thanks again Giorgio
William Morgan
2008-Jan-09 16:09 UTC
[sup-talk] interface blinking and corrupted on the console
Excerpts from Marcus Williams''s message of Sat Jan 05 12:11:14 -0800 2008:> I think checking if $TERM is one of "xterm.*" and "rxvt.*". I''d also > add "screen" to the list as well (because screen deals with it and my > main usage of sup is during a screen session :) and maybe "cyg.*" for > whatever the cygwin term variable is (I think its cygwin but might be > cygterm cant remember). Needs to be a regex because you get stuff > like xterm-color.Ok, I just committed this to git master: commit 9722a770cadd44ddc4af6ddcb56eb8edb35c93b9 Author: William Morgan <wmorgan-sup at masanjin.net> Date: Wed Jan 9 08:06:39 2008 -0800 only set terminal title if $TERM is an xterm or rxvt variant diff --git a/lib/sup/buffer.rb b/lib/sup/buffer.rb index fa1afe6..782695b 100644 --- a/lib/sup/buffer.rb +++ b/lib/sup/buffer.rb @@ -63,6 +63,7 @@ class Buffer @title = opts[:title] || "" @force_to_top = opts[:force_to_top] || false @x, @y, @width, @height = 0, 0, width, height + @in_x = ENV["TERM"] =~ /(xterm|rxvt)/ end def content_height; @height - 1; end @@ -262,7 +263,7 @@ EOS get_status_and_title @focus_buf # must be called outside of the ncurses end - print "\033]2;#{title}\07" if title + print "\033]2;#{title}\07" if title && @in_x Ncurses.mutex.lock unless opts[:sync] == false -- William <wmorgan-sup at masanjin.net>
Giorgio Lando
2008-Jan-09 17:49 UTC
[sup-talk] interface blinking and corrupted on the console
> only set terminal title if $TERM is an xterm or rxvt variantThanks. It would be nice if you could add the screen variants, because it works fine in screen, as someone else already noted. Giorgio
William Morgan
2008-Jan-09 18:09 UTC
[sup-talk] interface blinking and corrupted on the console
Excerpts from Giorgio Lando''s message of Wed Jan 09 09:49:18 -0800 2008:> Thanks. It would be nice if you could add the screen variants, because > it works fine in screen, as someone else already noted.Whoops. Added! -- William <wmorgan-sup at masanjin.net>
Marcus Williams
2008-Jan-09 21:09 UTC
[sup-talk] interface blinking and corrupted on the console
Excerpts from William Morgan''s message of Wed Jan 09 16:09:48 +0000 2008:> Ok, I just committed this to git master: > > commit 9722a770cadd44ddc4af6ddcb56eb8edb35c93b9 > Author: William Morgan <wmorgan-sup at masanjin.net> > Date: Wed Jan 9 08:06:39 2008 -0800 > > only set terminal title if $TERM is an xterm or rxvt variantI get lots of @in_x not initialised errors at the terminal title line (that ends && @in_x) Is the initialise routine called before the buffer titles are set? Marcus
William Morgan
2008-Jan-09 23:02 UTC
[sup-talk] interface blinking and corrupted on the console
Excerpts from Marcus Williams''s message of Wed Jan 09 13:09:47 -0800 2008:> I get lots of @in_x not initialised errors at the terminal title line > (that ends && @in_x) Is the initialise routine called before the > buffer titles are set?Whoops, I did something silly. Try it now. I just applied: diff --git a/lib/sup/buffer.rb b/lib/sup/buffer.rb index f724f88..2a78787 100644 --- a/lib/sup/buffer.rb +++ b/lib/sup/buffer.rb @@ -63,7 +63,6 @@ class Buffer @title = opts[:title] || "" @force_to_top = opts[:force_to_top] || false @x, @y, @width, @height = 0, 0, width, height - @in_x = ENV["TERM"] =~ /(xterm|rxvt|screen)/ end def content_height; @height - 1; end @@ -178,6 +177,7 @@ EOS @textfields = {} @flash = nil @shelled = @asking = false + @in_x = ENV["TERM"] =~ /(xterm|rxvt|screen)/ self.class.i_am_the_instance self end -- William <wmorgan-sup at masanjin.net>