using t.console on linux [SOLVED]

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
CodeRed
Prole
Posts: 5
Joined: Tue Aug 01, 2023 8:13 pm

using t.console on linux [SOLVED]

Post by CodeRed »

Hi, i have been wondering if there is a way to use the t.console on Linux or be able to replicate its function? My love set up is vscode using the love2d support extension to run the love appimage. The Linux Distro I am using is Linux Mint.
Last edited by CodeRed on Wed Aug 02, 2023 4:08 pm, edited 1 time in total.
zz_zz
Prole
Posts: 1
Joined: Wed Dec 14, 2022 12:05 pm

Re: using t.console on linux

Post by zz_zz »

CodeRed
Prole
Posts: 5
Joined: Tue Aug 01, 2023 8:13 pm

Re: using t.console on linux

Post by CodeRed »

that solution doesn't work for me because im using the appimage version of love so i can't use the love command.
User avatar
GVovkiv
Party member
Posts: 686
Joined: Fri Jan 15, 2021 7:29 am

Re: using t.console on linux

Post by GVovkiv »

CodeRed wrote: Wed Aug 02, 2023 2:37 am that solution doesn't work for me because im using the appimage version of love so i can't use the love command.
appimage is still executable, it doesn't work any differently from programs installed in different way. Just make sure that love appimage is runnable and run it in terminal. For example:

Code: Select all

/path/to/appimage/love-11.4-x86_64.AppImage
CodeRed
Prole
Posts: 5
Joined: Tue Aug 01, 2023 8:13 pm

Re: using t.console on linux

Post by CodeRed »

GVovkiv wrote: Wed Aug 02, 2023 10:53 am
CodeRed wrote: Wed Aug 02, 2023 2:37 am that solution doesn't work for me because im using the appimage version of love so i can't use the love command.
appimage is still executable, it doesn't work any differently from programs installed in different way. Just make sure that love appimage is runnable and run it in terminal. For example:

Code: Select all

/path/to/appimage/love-11.4-x86_64.AppImage
Yeah I can easily run love it self through a terminal just copy the location of love and past it into the terminal and press enter and it will run perfectly fine. I'm asking how to run my love game and be able to write to the console.
User avatar
GVovkiv
Party member
Posts: 686
Joined: Fri Jan 15, 2021 7:29 am

Re: using t.console on linux

Post by GVovkiv »

CodeRed wrote: Wed Aug 02, 2023 2:42 pm Yeah I can easily run love it self through a terminal just copy the location of love and past it into the terminal and press enter and it will run perfectly fine. I'm asking how to run my love game and be able to write to the console.
Pass argument to game path to love appimage, where main.lua is?
Like:

Code: Select all

/path/to/appimage/love-11.4-x86_64.AppImage /path/to/game
And add io.stdout:setvbuf("no") on top of main.lua?
Andlac028
Party member
Posts: 174
Joined: Fri Dec 14, 2018 2:27 pm
Location: Slovakia

Re: using t.console on linux

Post by Andlac028 »

CodeRed wrote: Wed Aug 02, 2023 2:42 pm
GVovkiv wrote: Wed Aug 02, 2023 10:53 am appimage is still executable, it doesn't work any differently from programs installed in different way. Just make sure that love appimage is runnable and run it in terminal. For example:

Code: Select all

/path/to/appimage/love-11.4-x86_64.AppImage
Yeah I can easily run love it self through a terminal just copy the location of love and past it into the terminal and press enter and it will run perfectly fine. I'm asking how to run my love game and be able to write to the console.
To run your game through terminal, just add path to folder with main.lua to it:

Code: Select all

/path/to/appimage/love-11.4-x86_64.AppImage path/to/folder/with/main/lua
If you want to read input from terminal, just use io.stdin:read() or just io.read(). But this would pause execution of the program until something is written to terminal, so you may want to run it in another thread (not sure, if it would work…)
CodeRed
Prole
Posts: 5
Joined: Tue Aug 01, 2023 8:13 pm

Re: using t.console on linux

Post by CodeRed »

GVovkiv wrote: Wed Aug 02, 2023 3:12 pm
CodeRed wrote: Wed Aug 02, 2023 2:42 pm Yeah I can easily run love it self through a terminal just copy the location of love and past it into the terminal and press enter and it will run perfectly fine. I'm asking how to run my love game and be able to write to the console.
Pass argument to game path to love appimage, where main.lua is?
Like:

Code: Select all

/path/to/appimage/love-11.4-x86_64.AppImage /path/to/game
And add io.stdout:setvbuf("no") on top of main.lua?
oh thank didn't know you could just pass an argument to game path to love appimage where main.lua is. That fixed the problem thank you.
User avatar
GVovkiv
Party member
Posts: 686
Joined: Fri Jan 15, 2021 7:29 am

Re: using t.console on linux

Post by GVovkiv »

CodeRed wrote: Wed Aug 02, 2023 4:04 pm oh thank didn't know you could just pass an argument to game path to love appimage where main.lua is. That fixed the problem thank you.
As I said, appimage love is just love, packaged as appimage, you can do with it same things, as other love *versions*, as dnf or flatpak distribution.
Post Reply

Who is online

Users browsing this forum: Ahrefs [Bot], Google [Bot] and 6 guests