Sublime Forum

Lua io.read() yields blank line

#1

Hello everyone,

I’ve just barely started with Lua. I fell instantly in love with Sublime, but I ran into one nagging thing. I have searched, seen it asked, but found no working solution.

When using io.read(), CTRL + B shows nothing for the input of the Player after entering a name when prompted. It’s just moves to a blank line and nothing is printed to the screen. Below is the code I am using; also I am using lua52.

print(“What is your name Player?”)

local Player = io.read()

print("Welcome to the game " … Player)

Any help would be greatly appreciated.

EDIT: Sorry. I forgot to mention that the code runs perfectly in ZeroBrane and from a console.

0 Likes

#2

Sublime doesn’t support running interactive programs without a third party package. I would recommend Terminus if you want to run code that requires user input directly within Sublime:

0 Likes

#3

Hello OdatNurd. Thank you for the helpful suggestion, as well as the excellent instructional video! I had a sublime cup of coffee watching it this morning. Terminus really is a fantastic package and will do perfectly.

Thanks again for the help; very much appreciated.

1 Like