zsh-workers
 help / color / mirror / code / Atom feed
* zcurses version of tetris
@ 2012-07-16 13:22 Mikael Magnusson
  2012-07-16 20:21 ` Bart Schaefer
  0 siblings, 1 reply; 2+ messages in thread
From: Mikael Magnusson @ 2012-07-16 13:22 UTC (permalink / raw)
  To: zsh workers

Hi,

I noticed we don't ship any contrib and/or example scripts using the
zcurses module, and also that the builtin tetris is sort of boring, so
I figured I'd port it to curses. It works pretty well, but I noticed
two problems with the zcurses module in the process:
1. the HAVE_USE_DEFAULT_COLORS define seems to never be defined?
2a. resizing the window causes 'zcurses input' to wait forever for a
key, even with a timeout defined.
2b. resizing the window doesn't cause an event while running the
program, but if i resize before starting(?) i get an event RESIZE on
my first input call.

Here's the current version if anyone wants to take a look,
http://mika.l3ib.org/code/zsh-functions/tetriscurses
and in case i'm fiddling around with it, the version when I sent this
mail, http://mika.l3ib.org/code/tetriscurses-1

-- 
Mikael Magnusson


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: zcurses version of tetris
  2012-07-16 13:22 zcurses version of tetris Mikael Magnusson
@ 2012-07-16 20:21 ` Bart Schaefer
  0 siblings, 0 replies; 2+ messages in thread
From: Bart Schaefer @ 2012-07-16 20:21 UTC (permalink / raw)
  To: zsh workers

On Jul 16,  3:22pm, Mikael Magnusson wrote:
}
} 2a. resizing the window causes 'zcurses input' to wait forever for a
} key, even with a timeout defined.

This probably has something to do with the special-casing around wgetch()
for signals handled by the "trap" command.  See the big comment in
Src/Modules/curses.c lines 1073-1103.

It may be problematic to mix curses with the generic signal handling in
the main shell.  We may need to swap in a SIGWINCH handler wrapper while
the curses UI is active, and restore the main handler when leaving it.

} 2b. resizing the window doesn't cause an event while running the
} program, but if i resize before starting(?) i get an event RESIZE on
} my first input call.

There's probably some state that needs to be cleared on entry to
zccmd_input() so that curses doesn't see something left over from the
previous signal.  Unfortunately I don't know what that would be.


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2012-07-16 20:22 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-07-16 13:22 zcurses version of tetris Mikael Magnusson
2012-07-16 20:21 ` Bart Schaefer

Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).