Page 1 of 2

Unresponsive console on windows

Posted: Tue Aug 14, 2012 6:38 am
by ixpnu
Hi all,
when i run löve 0.8.0 in console mode (using the --console option), the console is unresponsive. I get a flashing cursor but I can't write anything. Also, print calls from within the game prints nothing.

I'm running löve on windows. I've tried starting it from within gVim and from a terminal window. Both programs are 'portable' versions, since I don't have admin rights on the computer I'm using.

(I've tried the 'debug.lua' library as well, but then I got no response from the ctrl/shift-f8. Totally unrelated perhaps?)

Any suggestions?

Re: Unresponsive console on windows

Posted: Tue Aug 14, 2012 6:42 am
by verilog
Hi!
Are you including a conf.lua file inside your project? If not, make sure you include a file named "conf.lua" with the following configuration:

Code: Select all

function love.conf(t)
  t.console = true
end
That should enable the console :)

Re: Unresponsive console on windows

Posted: Tue Aug 14, 2012 7:22 am
by Boolsheet
There are several ways to to conjure up a Windows console.

Code: Select all

love.exe --console

Code: Select all

function love.conf(t)
  t.console = true
end

Code: Select all

love._openConsole()
They all use the same C++ function to do it and there should be no differences, except that the last one can be executed a little earlier than the others.

LÖVE 0.8.0 does some redirection magic on Windows that can interfere with applications that try to create or emulate a terminal (like MSYS' sh). I don't know what it exactly is. Maybe they try to capture the standard I/O from the program and the 0.8.0 redirection breaks this horribly. The redirection code was changed for the next version of LÖVE. Hopefully, it will be fixed.

The clean solution is to build LÖVE with console as the subsystem. No more redirection madness needed then. I'll try to get one up later.

By the way, the console should work as expected with cmd.exe. If it does not, then... I don't know. Try the lastest development builds? ;)

Edit: LÖVE 0.8.0 for Windows targeting the console subsystem.

Re: Unresponsive console on windows

Posted: Fri Aug 31, 2012 7:39 pm
by Öbey
--console conf.lua love._openConsole()
none of those works with the latest development build and 0.8.0

Also running within the command prompt is not an option because it returns back to command prompt immediately

Thus Console is not only broken on windows but there is also no workaround

Re: Unresponsive console on windows

Posted: Fri Aug 31, 2012 9:41 pm
by josefnpat
Unfortunatly, I am running linux, so I might not be of as much help as you would like, but try this:
  1. Copy the following to main.lua:

    Code: Select all

    name = io.read()
    
    function love.draw()
      love.graphics.print("Hello "..name.."!",0,0)
    end
  2. Open up command prompt (Windows+R;cmd.exe)
  3. Navigate to your folder e.g.:

    Code: Select all

    cd[/code\
    [*]Run love on the folder e.g.: [code]c:\<path to love.exe> .
  4. Type in your name in the console, and press enter.
This works on linux, and it probably works on windows. Most people are able to get --console and t.console to work, so please help determine an instruction set that will make this bug reproducible.

Re: Unresponsive console on windows

Posted: Fri Aug 31, 2012 11:05 pm
by Öbey
I have xp sp3
I tried the following with 0.8.0 and the latest development build.

1)
I run a folder X by dropping it on the love.exe
I have conf.lua with console set to true
I know it is read because I can change the title within the conf.lua
no console

2)
I run the command "love.exe --console X"
no console

3)
Added love._openConsole() to my main.lua
no console

EDIT:
However "love.exe --console" works
However "love.exe --console X" works if there is no script error

Re: Unresponsive console on windows

Posted: Sat Sep 01, 2012 12:35 am
by Boolsheet
I don't see this behaviour in my Windows XP SP3 and I don't know why console allocation would fail. Do you think the configuration of your system could interfere in some way?

Have you also tried my LÖVE 0.8.0 for Windows targeting the console subsystem? With this build you don't need to invoke the console with conf.lua/_openConsole/--console because it's enabled by default and will attach itself to the console of the command prompt if started from there.

Re: Unresponsive console on windows

Posted: Sat Sep 01, 2012 1:09 am
by Öbey
yes your build works
EDIT:
console opens in 0.8.0 if there is no error
but if there is an error it does not

Re: Unresponsive console on windows

Posted: Sat Sep 01, 2012 1:33 am
by Boolsheet
Öbey wrote:EDIT:
console opens in 0.8.0 if there is no error
but if there is an error it does not
This can happen if an error occurs before love.run is executed. A syntax error in main.lua for example. It is possible to open the console before that, just put love._openConsole() on the first line in main.lua (or conf.lua if you want it to open even earlier).

Re: Unresponsive console on windows

Posted: Sat Sep 01, 2012 9:06 am
by Öbey
as I said this is what is not working
neither of those open the console if there was an error
I expected --console to open the console in the first place but no, it also fails if there is an error