[Question]
  [
At runtime, keep prompting for *a line of input* until the user inputs something (other than an empty newline), i.e. does not just press `Enter` or `OK`. Output or result is neither required nor prohibited.
### Pseudo-code 1
```
myform = new form("GUI")
myform.mytxt = new editfield("")
myform.ok = new button("OK")
repeat
  waitfor(myform.ok,"click")
until myform.mytxt.content <> ""
```
### Pseudo-code 2
```
LET TEXT = ""
WHILE TEXT = "" DO
  TEXT = PROMPT("")
ENDWHILE
```
### Example 1
Program runs and immediately pops up a form with a single text field and an `OK` button.  
User clicks the `OK` button.  
Nothing happens.  
User pastes "hello world" into the text field and clicks the `OK` button.  
Program terminates.
### Example 2
Function is called and immediately displays a blank line and a blinking cursor.  
User presses `Enter`.  
Cursor moves down one line.  
User presses `Enter`.  
Cursor moves down one line.  
User presses `P``P``C``G``Enter`  
Function returns.
  
[Answer]
# TI-BASIC, 2 bytes
```
:Prompt X
```
TI-BASIC does this automatically. Once input is given, it will quit.
Here is a GIF:
[![enter image description here](https://i.stack.imgur.com/5dI5B.gif)](https://i.stack.imgur.com/5dI5B.gif)
Watch the count on the `enter` key in the Key Press History. Created with **TI-SmartView CE** and [ezgif.com](https://ezgif.com/).
[Answer]
# [Python 3](https://docs.python.org/3/), 18 bytes
```
while''==input():0
```
[Try it online!](https://tio.run/nexus/python3#@1@ekZmTqq5ua5uZV1BaoqFpZfC/oCgzr0QDytdUUFYIzsgvVyhKzU3MzMvMS1cAy@j95@LiSkxK5kpJTQMA "Python 3 – TIO Nexus")
[Answer]
# JavaScript, ~~37~~ ~~22~~ 17 bytes
```
while(!prompt());
```
```
while(!prompt());
```
## Explanation
The `while` keyword starts the `while` loop. In the condition of the loop, `!prompt()` asks for input and checks whether it is given or not. If it isn't given, the body of the loop is executed, which in our case is empty, then the interpreter goes back to the loop condition. The same process happens over and over again until the user gives the input.
[Answer]
# sed, 4
```
/./q
```
Waits for a line of input that has 1 or more characters, then quits.
[Try it online](https://tio.run/nexus/sed#@6@vp1/4/z8XV15@nm5qbkFJJRcA). But it works better on a live shell:
```
sed '/./q'
```
[Answer]
# Java, 55 bytes
```
void f()throws Exception{while(System.in.read()==10);}}
```
If I remember correctly (it's been a while since I've been active on PPCG), my program can just be a function.
This is system specific; it only works on systems where the end-of-line character is a single newline. If the end-of-line character is instead a carriage return, replace the `10` with `13`. On Windows, this doesn't work, as end-of-line on windows is `\r\n`.
This makes use of the fact that I can read directly from `System.in`.
[Answer]
# HTML5, ~~33~~ 22 bytes
```
<form><input required>
```
```
<form><input required>
```
## Explanation
The `required` attribute on the `<input>` causes the browser to inform the user "this field is required"-sort-of-message, if they do not enter a value. However, when they enter a value, the value is sent to the URL of the `action` attribute of the `<form>` (which in our case is the current file itself, since we haven't specified any value explicitly).
This was tested on the latest version of Google Chrome (version 55.0). May work in other browsers and versions.
[Answer]
# [Pyth](https://github.com/isaacg1/pyth), 3 bytes
```
W!w
```
[Try it online!](http://pyth.herokuapp.com/?code=W%21w&input=%0A%0A%0Aabc%0Adef&debug=0)
Translated to Python:
```
while Pnot(input()):
 pass
```
[Answer]
# [Jelly](https://github.com/DennisMitchell/jelly), 3 bytes
```
ɠṆ¿
```
Not much to look at on TIO, I'm afraid.
[Try it online!](https://tio.run/nexus/jelly#@39ywcOdbYf2///PxcWVmJTMlZKaBgA "Jelly – TIO Nexus")
### How it works
This is a niladic program, meaning that it takes no input arguments. The implicit argument and return value are both **0** in this case.
`¿` (while) is a quick that pops two links from the link stack: a condition (`Ṇ`) and a body.
`Ṇ` is a monadic atom: flat logical NOT. If the previous return value is falsy (here, **0** or an empty string), it returns **1** and the body is called.
`ɠ` is a niladic atom; it reads a raw line from STDIN and returns the result.
Once `ɠ` reads a non-empty line, `Ṇ` returns **0** and we break out of the loop.
[Answer]
# [brainfuck](https://github.com/TryItOnline/tio-transpilers), 26 bytes
```
+[>,----------[[-]<[-]>]<]
```
[Try it online!](https://tio.run/nexus/brainfuck#@68dbaejCwfR0bqxNkBsF2sT@/8/FxdXYlIyV0pqGgA "brainfuck – TIO Nexus")
[Answer]
# Perl 5, 8+1 (-p or -n flag) bytes
```
/./&&die
```
Takes input from stdin and dies as soon as the regex matches anything except a newline.
[Answer]
# C, ~~52 bytes~~, ~~33 bytes~~, 29 bytes
-19 bytes thanks to Justin
-4 bytes thanks to Christoph
```
main(){while(getchar()==10);}
```
10 is equal to '\n' - In case this isn't obvious.
[Answer]
## Bash, 51 bytes (39 without "#!/bin/bash")
It's my first time participating in PPCG, so dont be to rude ;D
```
#!/bin/bash
read a
while [ -z "$a" ]
do
read a
done
```
[Answer]
# R, ~~27~~ ~~24~~ ~~23~~ 22 bytes
```
while(!sum(scan()^0))t
```
Takes input from stdin, and repeat as long as input is of length 0. Cut off some bytes due to Jarko Dubbeldam and MickyT. Replaced the `{}` with `t` to save another byte.
[Answer]
# [Java](http://openjdk.java.net/), ~~128~~ 126 bytes
2 bytes thanks to Kevin Cruijssen.
```
import java.util.*;class a{public static void main(String[]a){for(Scanner s=new Scanner(System.in);s.nextLine().isEmpty(););}}
```
[Try it online!](https://tio.run/nexus/java-openjdk#LcexDsIgEADQna9gBAd@gDi6uTEahyul5gwcDXdtbZp@Ozo4vbyOZa5N9BtWcItgdhcfMzBrOOZlyBg1C8iPteKoCyCZIA3p9XiCPabaTIhAlJrmK6VN/2fCzpKKQ7KeHaWP3JGSsQ75VmbZjfXWn2fvSikYohrT9AU "Java (OpenJDK 8) – TIO Nexus")
[Answer]
# [AWK](https://www.gnu.org/software/gawk/manual/gawk.html), 8 11 bytes
```
NF{exit}
```
Wait for input. If the number of fields in input is more than 0, exit. 
**EDIT:**
I've just realized that this doesn't work for input containing whitespace characters only. IFS needs to be set to empty string using `-F ""` command line option. Therefore +3 bytes.
[Try it online!](https://tio.run/nexus/awk#@@/nVp1akVlS@/8/F5fCv/yCksz8vOL/um4KSkoA "AWK – TIO Nexus")
[Answer]
# [C# (.NET Core)](https://www.microsoft.com/net/core/platform), 66 bytes
```
class C{static void Main(){for(;System.Console.ReadLine()!="";);}}
```
[Try it online!](https://tio.run/nexus/cs-core#@5@ck1hcrOBcXVySWJKZrFCWn5mi4JuYmaehWZ2WX6RhHVxZXJKaq@ecn1ecn5OqF5SamOKTmZeqoaloq6RkrWldW/v/PwA "C# (.NET Core) – TIO Nexus")
-6 bytes thanks to raznagul.
[Answer]
## QBasic 4.5, 15 bytes
```
INPUT a$:IF a$=""THEN RUN
```
Asks for input, then checks if any was given. If not, `RUN` restarts the program.
[Answer]
# Ruby, 13 bytes
```
gets until/./
```
I wish `gets` took a Regexp argument.
[Answer]
# PHP, 18 bytes
```
while(!readline())
```
[Answer]
# SpecBAS - 34 bytes
```
1 DO : INPUT a$: LOOP UNTIL a$<>""
```
Just loops until non-empty string is entered.
[Answer]
# Perl, 15 12 bytes (11 + -n flag)
-3 bytes thanks to manatwork
```
1/0if$/ne$_
```
Explanation:
The -n flag places a read loop around the program, turning it into:
```
LINE:
while (<>) {
    1/0 if $/ ne $_  # Spaces added for clarity.
}
```
Where "<>" reads a line from stdin to the variable $\_. If the line contained more than the ending newline (ne is string inequality, $/ is the input record separator which defaults to newline), a division by zero is performed which causes the program to output an error message and terminate.
[Answer]
# Mathematica, ~~26~~ 20 bytes
```
For[,Input[]==Null,]
```
[Answer]
## Haskell, ~~19~~ 17 bytes
```
f=do""<-getLine;f
```
Defines a function `f` that if it reads the empty line calls itself again. When reading a non-empty line an exception is raised and the recursion is stopped.
Edit: @Laikoni replaced the parameter with a pattern match and saved 2 bytes. Thanks!
[Answer]
# [Aceto](https://github.com/L3viathan/Aceto), ~~9~~ ~~5~~ 4 bytes
`r`ead a value, negate it (`!`; implicitly casting to a boolean), and mirror horizontally if the value is truthy (`|`).
```
!
r|
```
[Answer]
# Java, ~~66~~ ~~64~~ 60 bytes
```
int a(){return!System.console().readLine().isEmpty()?0:a();}
```
My first Java answer, would love some tips!
[Answer]
# [Charcoal](https://github.com/somebody1234/Charcoal), 4 bytes
```
Ｗ¬Ｓω
```
## Explanation
```
Ｗ      While
  ¬Ｓ   Logical not of string input
     ω  Print ""
```
[Answer]
# [05AB1E](https://github.com/Adriandmen/05AB1E), 5 bytes
```
[IõÊ#
```
Explanation:
```
[     Start infinite loop
 I    One line of input
   Ê  Not equal to
  õ   Empty string
    # Break if true
```
[Try it online!](https://tio.run/nexus/05ab1e#@x/teXjr4S7l//@5uLgSk5K5UlLTAA "05AB1E – TIO Nexus")
[Answer]
# PowerShell, 20 Bytes
```
for(;!(read-host)){}
```
runs a for loop,
`read-host` prompts for input
if read-host returns nothing it evals to false, so we invert that `!(...)` and use that as the loop end check.
much shorter than any `do{$a=read-host}while($a-eq"")` type solution involving variables.
[Answer]
# Swift, 22 bytes
```
while readLine()==""{}
```
[Answer]
# [CJam](https://sourceforge.net/p/cjam), 5 bytes
```
{l!}g
```
[Try it online!](https://tio.run/nexus/cjam#@1@do1ib/v8/FwgkJiUDAA "CJam – TIO Nexus")
(TIO doesn't really show the proper behaviour)
**Explanation**
```
{      e# Do:
 l     e#  Read next line of input
  !    e#  Boolean negate (empty strings are falsy)
   }g  e# Pop the top of stack, if truthy, repeat.
```
]