How to attach console on Linux Ubuntu?

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.
Post Reply
User avatar
GVovkiv
Party member
Posts: 670
Joined: Fri Jan 15, 2021 7:29 am

How to attach console on Linux Ubuntu?

Post by GVovkiv »

Linux Ubuntu
So, i know, on Windows you can use conf.lua or --console, but how to do something like this on Ubuntu?
User avatar
pgimeno
Party member
Posts: 3550
Joined: Sun Oct 18, 2015 2:58 pm

Re: How to attach console on Linux Ubuntu?

Post by pgimeno »

Just run it from a terminal.
Teo434
Prole
Posts: 11
Joined: Mon Apr 27, 2020 12:21 am

Re: How to attach console on Linux Ubuntu?

Post by Teo434 »

GVovkiv wrote: Mon Feb 01, 2021 9:30 pm Linux Ubuntu
So, i know, on Windows you can use conf.lua or --console, but how to do something like this on Ubuntu?
There's unfortunately no way to do this. :( However, there are 2 solutions to still see the console! ^^

1. Running from the terminal.
You can open a terminal in the folder avobe where main.lua is stored, and then do either:

Code: Select all

love (folder where main.lua is stored) --console 
or

Code: Select all

love2d (folder where main.lua is stored) --console 
.
This runs love2d as normal, but the terminal acts as a console like if you were on windows. ^^

QUICK NOTE: I forgot if it was -console or --console, and the code was formatted to look like a comment aswell, don't get confused!

2. Sublime Text 3
Sublime Text (and probably other IDE's aswell) have a built-in console. I know that Sublime Text at least, works fine.
Using an IDE that supports terminal does not require you to have console enabled in conf.lua ^^

https://love2d.org/wiki/Sublime_Text

However, if you're using Sublime Text, it won't print in real time. To fix this, you can add the following code at the top of main.lua or conf.lua:

Code: Select all

io.stdout:setvbuf("no")
Hope that helped! :awesome:
User avatar
GVovkiv
Party member
Posts: 670
Joined: Fri Jan 15, 2021 7:29 am

Re: How to attach console on Linux Ubuntu?

Post by GVovkiv »

Teo434 wrote: Tue Feb 02, 2021 8:13 pm
GVovkiv wrote: Mon Feb 01, 2021 9:30 pm Linux Ubuntu
So, i know, on Windows you can use conf.lua or --console, but how to do something like this on Ubuntu?
There's unfortunately no way to do this. :( However, there are 2 solutions to still see the console! ^^

1. Running from the terminal.
You can open a terminal in the folder avobe where main.lua is stored, and then do either:

Code: Select all

love (folder where main.lua is stored) --console 
or

Code: Select all

love2d (folder where main.lua is stored) --console 
.
This runs love2d as normal, but the terminal acts as a console like if you were on windows. ^^

QUICK NOTE: I forgot if it was -console or --console, and the code was formatted to look like a comment aswell, don't get confused!

2. Sublime Text 3
Sublime Text (and probably other IDE's aswell) have a built-in console. I know that Sublime Text at least, works fine.
Using an IDE that supports terminal does not require you to have console enabled in conf.lua ^^

https://love2d.org/wiki/Sublime_Text

However, if you're using Sublime Text, it won't print in real time. To fix this, you can add the following code at the top of main.lua or conf.lua:

Code: Select all

io.stdout:setvbuf("no")
Hope that helped! :awesome:
Thanks for the detailed answer, it was helpful!
CodeRed
Prole
Posts: 5
Joined: Tue Aug 01, 2023 8:13 pm

Re: How to attach console on Linux Ubuntu?

Post by CodeRed »

what if im using the appimage version will the love command still work?
User avatar
Pinko
Prole
Posts: 45
Joined: Sat Jul 29, 2023 3:22 pm
Contact:

Re: How to attach console on Linux Ubuntu?

Post by Pinko »

open a terminal in Linux. Love2D has to be installed on your computer already.

Either type in love (and enter) to see no game screen or

type in:

Code: Select all

love --version 
to see your installed version of love2D

in my terminal:
LOVE 11.5 (Mysterious Mysteries)

then go to the folder, where main.lua is stored:

cd /home/mike/code/mikesprogram

in this folder you start the program with

Code: Select all

 love .
love onespace and onedot (enter)
Author of the vape knigge. I have thought of you! is much better than "i have waited for you". :cool:
User avatar
GVovkiv
Party member
Posts: 670
Joined: Fri Jan 15, 2021 7:29 am

Re: How to attach console on Linux Ubuntu?

Post by GVovkiv »

Pinko wrote: Sun Sep 10, 2023 4:09 pm ...
I mean, thanks, but you kinda late for almost 3 years
User avatar
Pinko
Prole
Posts: 45
Joined: Sat Jul 29, 2023 3:22 pm
Contact:

Re: How to attach console on Linux Ubuntu?

Post by Pinko »

GVovkiv wrote: Sun Sep 10, 2023 5:21 pm
Pinko wrote: Sun Sep 10, 2023 4:09 pm ...
I mean, thanks, but you kinda late for almost 3 years
Yeah, i am always happy, when i can help someone. Maybe someone else could read this, too? Someone coming from windows to linux may have a little struggle with linux at first.

I love you all
Pinko
Author of the vape knigge. I have thought of you! is much better than "i have waited for you". :cool:
Post Reply

Who is online

Users browsing this forum: Google [Bot] and 210 guests