* [sup-talk] interface blinking and corrupted on the console
@ 2008-01-05 12:58 Giorgio Lando
2008-01-05 18:33 ` William Morgan
0 siblings, 1 reply; 12+ messages in thread
From: Giorgio Lando @ 2008-01-05 12:58 UTC (permalink / raw)
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
^ permalink raw reply [flat|nested] 12+ messages in thread
* [sup-talk] interface blinking and corrupted on the console
2008-01-05 12:58 [sup-talk] interface blinking and corrupted on the console Giorgio Lando
@ 2008-01-05 18:33 ` William Morgan
2008-01-05 20:11 ` Marcus Williams
` (2 more replies)
0 siblings, 3 replies; 12+ messages in thread
From: William Morgan @ 2008-01-05 18:33 UTC (permalink / raw)
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>
^ permalink raw reply [flat|nested] 12+ messages in thread
* [sup-talk] interface blinking and corrupted on the console
2008-01-05 18:33 ` William Morgan
@ 2008-01-05 20:11 ` Marcus Williams
2008-01-09 16:09 ` William Morgan
2008-01-05 21:32 ` Giorgio Lando
2008-01-06 22:54 ` Giorgio Lando
2 siblings, 1 reply; 12+ messages in thread
From: Marcus Williams @ 2008-01-05 20:11 UTC (permalink / raw)
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
^ permalink raw reply [flat|nested] 12+ messages in thread
* [sup-talk] interface blinking and corrupted on the console
2008-01-05 20:11 ` Marcus Williams
@ 2008-01-09 16:09 ` William Morgan
2008-01-09 17:49 ` Giorgio Lando
2008-01-09 21:09 ` Marcus Williams
0 siblings, 2 replies; 12+ messages in thread
From: William Morgan @ 2008-01-09 16:09 UTC (permalink / raw)
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>
^ permalink raw reply [flat|nested] 12+ messages in thread
* [sup-talk] interface blinking and corrupted on the console
2008-01-09 16:09 ` William Morgan
@ 2008-01-09 17:49 ` Giorgio Lando
2008-01-09 18:09 ` William Morgan
2008-01-09 21:09 ` Marcus Williams
1 sibling, 1 reply; 12+ messages in thread
From: Giorgio Lando @ 2008-01-09 17:49 UTC (permalink / raw)
> only set terminal title if $TERM is an xterm or rxvt variant
Thanks. It would be nice if you could add the screen variants, because it works fine in screen,
as someone else already noted.
Giorgio
^ permalink raw reply [flat|nested] 12+ messages in thread
* [sup-talk] interface blinking and corrupted on the console
2008-01-09 16:09 ` William Morgan
2008-01-09 17:49 ` Giorgio Lando
@ 2008-01-09 21:09 ` Marcus Williams
2008-01-09 23:02 ` William Morgan
1 sibling, 1 reply; 12+ messages in thread
From: Marcus Williams @ 2008-01-09 21:09 UTC (permalink / raw)
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 variant
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?
Marcus
^ permalink raw reply [flat|nested] 12+ messages in thread
* [sup-talk] interface blinking and corrupted on the console
2008-01-09 21:09 ` Marcus Williams
@ 2008-01-09 23:02 ` William Morgan
2008-01-10 11:37 ` Marcus Williams
0 siblings, 1 reply; 12+ messages in thread
From: William Morgan @ 2008-01-09 23:02 UTC (permalink / raw)
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>
^ permalink raw reply [flat|nested] 12+ messages in thread
* [sup-talk] interface blinking and corrupted on the console
2008-01-05 18:33 ` William Morgan
2008-01-05 20:11 ` Marcus Williams
@ 2008-01-05 21:32 ` Giorgio Lando
2008-01-05 22:01 ` Marcus Williams
2008-01-06 22:54 ` Giorgio Lando
2 siblings, 1 reply; 12+ messages in thread
From: Giorgio Lando @ 2008-01-05 21:32 UTC (permalink / raw)
> 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, 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
^ permalink raw reply [flat|nested] 12+ messages in thread
* [sup-talk] interface blinking and corrupted on the console
2008-01-05 21:32 ` Giorgio Lando
@ 2008-01-05 22:01 ` Marcus Williams
0 siblings, 0 replies; 12+ messages in thread
From: Marcus Williams @ 2008-01-05 22:01 UTC (permalink / raw)
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
^ permalink raw reply [flat|nested] 12+ messages in thread
* [sup-talk] interface blinking and corrupted on the console
2008-01-05 18:33 ` William Morgan
2008-01-05 20:11 ` Marcus Williams
2008-01-05 21:32 ` Giorgio Lando
@ 2008-01-06 22:54 ` Giorgio Lando
2 siblings, 0 replies; 12+ messages in thread
From: Giorgio Lando @ 2008-01-06 22:54 UTC (permalink / raw)
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
^ permalink raw reply [flat|nested] 12+ messages in thread
end of thread, other threads:[~2008-01-10 11:37 UTC | newest]
Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-01-05 12:58 [sup-talk] interface blinking and corrupted on the console Giorgio Lando
2008-01-05 18:33 ` William Morgan
2008-01-05 20:11 ` Marcus Williams
2008-01-09 16:09 ` William Morgan
2008-01-09 17:49 ` Giorgio Lando
2008-01-09 18:09 ` William Morgan
2008-01-09 21:09 ` Marcus Williams
2008-01-09 23:02 ` William Morgan
2008-01-10 11:37 ` Marcus Williams
2008-01-05 21:32 ` Giorgio Lando
2008-01-05 22:01 ` Marcus Williams
2008-01-06 22:54 ` Giorgio Lando
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox