Unresponsive console on windows

Questions about the LÖVE API, installing LÖVE and other support related questions go here.
Forum rules
Before you make a thread asking for help, read this.
ixpnu
Prole
Posts: 4
Joined: Mon Apr 02, 2012 1:56 pm

Unresponsive console on windows

Post 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?
User avatar
verilog
Citizen
Posts: 97
Joined: Thu Nov 03, 2011 3:15 am
Contact:

Re: Unresponsive console on windows

Post 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 :)
Last edited by verilog on Tue Aug 14, 2012 9:31 am, edited 1 time in total.
User avatar
Boolsheet
Inner party member
Posts: 780
Joined: Wed Dec 29, 2010 4:57 am
Location: Switzerland

Re: Unresponsive console on windows

Post 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.
Shallow indentations.
Öbey
Prole
Posts: 13
Joined: Wed Aug 08, 2012 7:18 am

Re: Unresponsive console on windows

Post 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
User avatar
josefnpat
Inner party member
Posts: 955
Joined: Wed Oct 05, 2011 1:36 am
Location: your basement
Contact:

Re: Unresponsive console on windows

Post 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.
Missing Sentinel Software | Twitter

FORCIBLY IGNORED.
<leafo> when in doubt delete all of your code
<bartbes> git rm -r *
<bartbes> git commit -m "Fixed all bugs"
<bartbes> git push
Öbey
Prole
Posts: 13
Joined: Wed Aug 08, 2012 7:18 am

Re: Unresponsive console on windows

Post 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
Last edited by Öbey on Sat Sep 01, 2012 1:16 am, edited 1 time in total.
User avatar
Boolsheet
Inner party member
Posts: 780
Joined: Wed Dec 29, 2010 4:57 am
Location: Switzerland

Re: Unresponsive console on windows

Post 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.
Shallow indentations.
Öbey
Prole
Posts: 13
Joined: Wed Aug 08, 2012 7:18 am

Re: Unresponsive console on windows

Post 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
User avatar
Boolsheet
Inner party member
Posts: 780
Joined: Wed Dec 29, 2010 4:57 am
Location: Switzerland

Re: Unresponsive console on windows

Post 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).
Shallow indentations.
Öbey
Prole
Posts: 13
Joined: Wed Aug 08, 2012 7:18 am

Re: Unresponsive console on windows

Post 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
Post Reply

Who is online

Users browsing this forum: Bing [Bot] and 28 guests