Discussion:
[Urwid] Possible Urwid frontend
Thomas Ballinger
2013-06-29 05:18:09 UTC
Permalink
Has there been any work on or does there already exist an Urwid frontend
that would work for keeping history for a widget-drawing REPL integrated
with the rest of terminal history?

I'm playing with the idea here (
https://github.com/thomasballinger/scottwasright, screencast
and mentioned
it in the the #bpython irc channel, where it was suggested to me this might
make sense as an Urwid frontend. Is this within the purvue of Urwid? (the
repl use case seems fairly different from apps using Urwid I'm used besides
bpython) If so, is this still too special-purpose to think about
integrating into Urwid as a frontend?

-Tom
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.excess.org/pipermail/urwid/attachments/20130629/cb9aa2dc/attachment.htm
Thomas Ballinger
2014-05-10 02:03:02 UTC
Permalink
Following up on this:

http://ballingt.com/2013/12/21/bpython-curtsies.html shows examples, and is
included in the soon-to-be-released bpython 0.13.

Does support for command line interfaces with this behavior belong in
urwid? I've used my own terminal wrapper thing (
https://github.com/thomasballinger/curtsies) but using urwid instead would
be cool (as would understanding urwid well enough to know that this
functionality doesn't belong in urwid). Thoughts?

Thanks,

Tom
Post by Thomas Ballinger
Has there been any work on or does there already exist an Urwid frontend
that would work for keeping history for a widget-drawing REPL integrated
with the rest of terminal history?
I'm playing with the idea here (
https://github.com/thomasballinger/scottwasright, screencast
http://youtu.be/9-W3M7L0ovQ and
mentioned it in the the #bpython irc channel, where it was suggested to me
this might make sense as an Urwid frontend. Is this within the purvue of
Urwid? (the repl use case seems fairly different from apps using Urwid I'm
used besides bpython) If so, is this still too special-purpose to think
about integrating into Urwid as a frontend?
-Tom
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.excess.org/pipermail/urwid/attachments/20140509/f1fffe50/attachment.htm
Ian Ward
2014-05-10 12:34:26 UTC
Permalink
Absolutely

I started work in this direction with raw_display but never quite finished.

I'd be happy to use code from curtsies to finish my raw_display hack and/or
add a curtsies_display module.

I was also thinking that curtsies looked perfect for a the terminal widget
to use instead of the current unpleasant list of lists of tuples.
Post by Thomas Ballinger
http://ballingt.com/2013/12/21/bpython-curtsies.html shows examples, and
is included in the soon-to-be-released bpython 0.13.
Post by Thomas Ballinger
Does support for command line interfaces with this behavior belong in
urwid? I've used my own terminal wrapper thing (
https://github.com/thomasballinger/curtsies) but using urwid instead would
be cool (as would understanding urwid well enough to know that this
functionality doesn't belong in urwid). Thoughts?
Post by Thomas Ballinger
Thanks,
Tom
On Sat, Jun 29, 2013 at 1:18 AM, Thomas Ballinger <tom at hackerschool.com>
Post by Thomas Ballinger
Has there been any work on or does there already exist an Urwid frontend
that would work for keeping history for a widget-drawing REPL integrated
with the rest of terminal history?
Post by Thomas Ballinger
Post by Thomas Ballinger
I'm playing with the idea here (
https://github.com/thomasballinger/scottwasright, screencast
http://youtu.be/9-W3M7L0ovQ and mentioned
it in the the #bpython irc channel, where it was suggested to me this might
make sense as an Urwid frontend. Is this within the purvue of Urwid? (the
repl use case seems fairly different from apps using Urwid I'm used besides
bpython) If so, is this still too special-purpose to think about
integrating into Urwid as a frontend?
Post by Thomas Ballinger
Post by Thomas Ballinger
-Tom
_______________________________________________
Urwid mailing list
Urwid at lists.excess.org
http://lists.excess.org/mailman/listinfo/urwid
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.excess.org/pipermail/urwid/attachments/20140510/f56f162d/attachment.htm
Ian Ward
2014-05-10 19:33:27 UTC
Permalink
Post by Ian Ward
Absolutely
I started work in this direction with raw_display but never quite finished.
In particular, the way I started to implement this feature was to have
the user set alternate_buffer=False when raw_display.Screen.start()
and then when the application didn't draw on the lower portion of the
screen (left it as blank space with the default display attributes)
then that many rows of the original screen would be left intact above
where the urwid application was drawing.

I ran into trouble with the way different terminals handled
positioning the cursor after a newline. I couldn't use absolute
positioning any more because I didn't know if the screen had scrolled.
I'm interested to look at your solution.

I also wonder why I missed your first email. Was it sent to this list?

Ian
Thomas Ballinger
2014-05-11 00:47:56 UTC
Permalink
That sounds about like how I'm doing it - the application has the whole
screen to write, but if it only uses the top, the terminal wrapper doesn't
touch everything below.

You may have gotten as far as I have - I haven't done a ton of testing with
different terminals. I don't recall having trouble with writing a full line
at the bottom, but I think I never write newlines - I just go to the next
line and keep writing.

I sent the first email to the list, but it was 11 months ago :) Perhaps I
hadn't signed up for the list yet? I probably sent it right after signing
up.

Tom
Post by Ian Ward
Post by Ian Ward
Absolutely
I started work in this direction with raw_display but never quite
finished.
In particular, the way I started to implement this feature was to have
the user set alternate_buffer=False when raw_display.Screen.start()
and then when the application didn't draw on the lower portion of the
screen (left it as blank space with the default display attributes)
then that many rows of the original screen would be left intact above
where the urwid application was drawing.
I ran into trouble with the way different terminals handled
positioning the cursor after a newline. I couldn't use absolute
positioning any more because I didn't know if the screen had scrolled.
I'm interested to look at your solution.
I also wonder why I missed your first email. Was it sent to this list?
Ian
_______________________________________________
Urwid mailing list
Urwid at lists.excess.org
http://lists.excess.org/mailman/listinfo/urwid
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.excess.org/pipermail/urwid/attachments/20140510/5dcda173/attachment.htm
Devin Jeanpierre
2014-05-11 05:12:29 UTC
Permalink
Post by Thomas Ballinger
That sounds about like how I'm doing it - the application has the whole
screen to write, but if it only uses the top, the terminal wrapper doesn't
touch everything below.
You may have gotten as far as I have - I haven't done a ton of testing with
different terminals. I don't recall having trouble with writing a full line
at the bottom, but I think I never write newlines - I just go to the next
line and keep writing.
I sent the first email to the list, but it was 11 months ago :) Perhaps I
hadn't signed up for the list yet? I probably sent it right after signing
up.
You sent the email successfully to the list: I have it. It must be a
problem with Ian's computer. ;)

-- Devin
Post by Thomas Ballinger
Tom
Post by Ian Ward
Post by Ian Ward
Absolutely
I started work in this direction with raw_display but never quite finished.
In particular, the way I started to implement this feature was to have
the user set alternate_buffer=False when raw_display.Screen.start()
and then when the application didn't draw on the lower portion of the
screen (left it as blank space with the default display attributes)
then that many rows of the original screen would be left intact above
where the urwid application was drawing.
I ran into trouble with the way different terminals handled
positioning the cursor after a newline. I couldn't use absolute
positioning any more because I didn't know if the screen had scrolled.
I'm interested to look at your solution.
I also wonder why I missed your first email. Was it sent to this list?
Ian
_______________________________________________
Urwid mailing list
Urwid at lists.excess.org
http://lists.excess.org/mailman/listinfo/urwid
_______________________________________________
Urwid mailing list
Urwid at lists.excess.org
http://lists.excess.org/mailman/listinfo/urwid
Loading...