[code] Textadept-curses for WIN32: Problems with os.spawn, os.execute and io.popen

From: Gavin Holt <holtgavin.att.gmail.com>
Date: Mon, 13 Jan 2020 12:31:02 +0000


I have posted some successes with Textadept-curses, as I explore there are
a few problems specific to Textadept-curses for WIN32.

I don't have the knowledge to identify which problems arise from the
'Microsoft - Windows Console[1]','PDCurses library[2]','Lua 5.3
interpreter[3]', 'Textadept-curses.exe [4]','gtdialog [5]','cdk
[6]','libtermkey [7]' I have used a pristine download to exclude my own
configurations ;)

1) os.spawn error

The CURSES and WIN32 version of os.spawn is defined in core/init.lua:20 and
I get errors which seem to be due to missing parameters.

Test case is trying to load the manual using the command list - keys.msc
(Help: Show Manual) from textadept-curses.

Error message is "TextAdept.10.8/core/init.lua:24: bad argument #1 to
'type' (value expected)".

Is my simple fix of adding "if (select(i,...)) and" on lines 24 and 28
enough for this function to work as required for all instances/parameters?

2) os.execute writes text over the application

I notice that os.execute is not called anywhere in Textadept (or

When I make a call, using the command entry line or repl, the screen shows
the output over the top of Textadept.

Is there any way to intercept/redefine this function to redirect output to
the message buffer?

3) io.popen kills the mouse

Every time a function calls io.popen I loose mouse input until I close and
restart textadept-curses.exe.

Test case execute this line "t = io.popen("dir *.* ","r") output =
t:read('*all') t:close() print(output)".

Is there any way to reinstate mouse input after io.popen?

Many thanks

Kind Regards Gavin Holt

[1] https://github.com/microsoft/terminal
[2] https://pdcurses.org/
[3] https://www.lua.org/
[5] https://foicica.com/gtdialog/
[6] https://invisible-island.net/cdk/
[7] http://www.leonerd.org.uk/code/libtermkey/
[8] https://foicica.com/textadept/download/textadept_10.8.modules.zip

You are subscribed to code.att.foicica.com.
To change subscription settings, send an e-mail to code+help.att.foicica.com.
To unsubscribe, send an e-mail to code+unsubscribe.att.foicica.com.
Received on Mon 13 Jan 2020 - 07:31:02 EST

This archive was generated by hypermail 2.2.0 : Tue 14 Jan 2020 - 06:33:41 EST