Re: Inconsistent Multiline String Handling in Lua REPL (Direct Input vs. History Recall)

mjmouse9999 <[email protected]> Thu, 30 Jul 2026 06:17:11 -0700 (PDT)
Newsgroups gmane.comp.lang.lua.general
Message-ID <[email protected]>
------=_Part_488752_159406198.1785417431392
Content-Type: multipart/alternative; 
	boundary="----=_Part_488753_1279448002.1785417431392"

------=_Part_488753_1279448002.1785417431392
Content-Type: text/plain; charset="UTF-8"

On Thursday, July 30, 2026 at 10:08:55PM mathieu stumpf-guntz wrote:
> Hello dear Lua community,
>
> In Lua REPL, direct input of multiline strings fails with a syntax error,
> while recalling the same input via history navigation (up arrow) executes
> correctly. This behavior is observed starting from Lua 5.3.x. In Lua 
5.2.4,
> history navigation as a feature did not exist, so the issue cannot be
> verified in earlier versions.
>
> Steps to Reproduce:
>  1. Launch Lua REPL (tested versions: 5.2.4, 5.3.6, 5.5.0).

Your results indicate that you launched it with the input not being attached
to a tty, similar to:

    $ lua <<< $'[[\ntest\n]]\n'
    lua: stdin:3: unexpected symbol near '[[test
    ]]'

>  2. Input a multiline string directly:
>     > [[ \ntest\n]]
>     Output: stdin:3: unexpected symbol near '[[test\n]]' (error in all 
tested versions).
>
>  3. Press the up arrow to recall and re-execute the same input.
>
> [...]

-- 
You received this message because you are subscribed to the Google Groups "lua-l" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [email protected].
To view this discussion visit https://groups.google.com/d/msgid/lua-l/14d5db8b-2f85-4b6d-8bf1-807dddec2aafn%40googlegroups.com.

------=_Part_488753_1279448002.1785417431392
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

On Thursday, July 30, 2026 at 10:08:55PM mathieu stumpf-guntz wrote:<br />&=
gt; Hello dear Lua community,<br />&gt;<br />&gt; In Lua REPL, direct input=
 of multiline strings fails with a syntax error,<br />&gt; while recalling =
the same input via history navigation (up arrow) executes<br />&gt; correct=
ly. This behavior is observed starting from Lua 5.3.x. In Lua 5.2.4,<br />&=
gt; history navigation as a feature did not exist, so the issue cannot be<b=
r />&gt; verified in earlier versions.<br />&gt;<br />&gt; Steps to Reprodu=
ce:<br />&gt; =C2=A01. Launch Lua REPL (tested versions: 5.2.4, 5.3.6, 5.5.=
0).<br /><br />Your results indicate that you launched it with the input no=
t being attached<br />to a tty, similar to:<br /><br />=C2=A0 =C2=A0 $ lua =
&lt;&lt;&lt; $'[[\ntest\n]]\n'<br />=C2=A0 =C2=A0 lua: stdin:3: unexpected =
symbol near '[[test<br />=C2=A0 =C2=A0 ]]'<br /><br />&gt; =C2=A02. Input a=
 multiline string directly:<br />&gt; =C2=A0 =C2=A0 &gt; [[ \ntest\n]]<br /=
>&gt; =C2=A0 =C2=A0 Output: stdin:3: unexpected symbol near '[[test\n]]' (e=
rror in all tested versions).<br />&gt;<br />&gt; =C2=A03. Press the up arr=
ow to recall and re-execute the same input.<br />&gt;<br />&gt; [...]<br />

<p></p>

-- <br />
You received this message because you are subscribed to the Google Groups &=
quot;lua-l&quot; group.<br />
To unsubscribe from this group and stop receiving emails from it, send an e=
mail to <a href=3D"mailto:[email protected]">lua-l+unsubsc=
[email protected]</a>.<br />
To view this discussion visit <a href=3D"https://groups.google.com/d/msgid/=
lua-l/14d5db8b-2f85-4b6d-8bf1-807dddec2aafn%40googlegroups.com?utm_medium=
=3Demail&utm_source=3Dfooter">https://groups.google.com/d/msgid/lua-l/14d5d=
b8b-2f85-4b6d-8bf1-807dddec2aafn%40googlegroups.com</a>.<br />

------=_Part_488753_1279448002.1785417431392--

------=_Part_488752_159406198.1785417431392--