Skip Menu |
Report information
Id: 70297
Status: open
Priority: 0/
Queue: perl6

Owner: Nobody
Requestors: masak <cmasak [at] gmail.com>
Cc:
AdminCc:

Severity: (no value)
Tag: testcommitted
Platform: (no value)
Patch Status: (no value)
VM: (no value)



Subject: [BUG] No explicit ^D and no newline after ^D in the REPL in Rakudo
Date: Fri, 6 Nov 2009 17:50:23 +0100
To: rakudobug [...] perl.org
From: Carl Mäsak <cmasak [...] gmail.com>
Download (untitled) / with headers
text/plain 414b
kaye:~ masak$ perl6 Show quoted text
> kaye:~ masak$
Compare irb and python: $ irb Show quoted text
>> ^Dkaye:~ masak$
kaye:~ masak$ python Python 2.6.1 (r261:67515, Jul 7 2009, 23:51:51) [GCC 4.2.1 (Apple Inc. build 5646)] on darwin Type "help", "copyright", "credits" or "license" for more information. Show quoted text
>>> ^D
kaye:~ masak$ Irb shows a '^D'. Python does both that and puts in an extra newline to unclutter things. Python has it right, IMHO.
CC: bugs-bitbucket [...] netlabs.develooper.com
Subject: Re: [perl #70297] [BUG] No explicit ^D and no newline after ^D in the REPL in Rakudo
Date: Fri, 6 Nov 2009 13:10:45 -0500
To: perl6-compiler [...] perl.org
From: Will Coleda <will [...] coleda.com>
Download (untitled) / with headers
text/plain 885b
On Fri, Nov 6, 2009 at 11:50 AM, Carl Mäsak <perl6-bugs-followup@perl.org> wrote: Show quoted text
> # New Ticket Created by  "Carl Mäsak" > # Please include the string:  [perl #70297] > # in the subject line of all future correspondence about this issue. > # <URL: http://rt.perl.org/rt3/Ticket/Display.html?id=70297 > > > > kaye:~ masak$ perl6
>> kaye:~ masak$
> > Compare irb and python: > > $ irb
>>> ^Dkaye:~ masak$
> > kaye:~ masak$ python > Python 2.6.1 (r261:67515, Jul  7 2009, 23:51:51) > [GCC 4.2.1 (Apple Inc. build 5646)] on darwin > Type "help", "copyright", "credits" or "license" for more information.
>>>> ^D
> kaye:~ masak$ > > Irb shows a '^D'. Python does both that and puts in an extra newline > to unclutter things. Python has it right, IMHO. >
To provide another interactive shell example (but not a vote): (I hit ^D after the %) $ tclsh8.5 % $ -- Will "Coke" Coleda
CC: perl6-compiler [...] perl.org, bugs-bitbucket [...] netlabs.develooper.com
Subject: Re: [perl #70297] [BUG] No explicit ^D and no newline after ^D in the REPL in Rakudo
Date: Fri, 06 Nov 2009 11:47:33 -0800
To: Will Coleda <will [...] coleda.com>
From: Geoffrey Broadwell <geoff [...] broadwell.org>
Download (untitled) / with headers
text/plain 321b
I have always preferred the look that masak++ suggests: ^D or ^C or ^Z (as appropriate) followed by newline. Thus I vote +1, as long as the correct character can be determined in the current environment. I also like to see "Received SIGFOO, exiting.\n" for signals that we interpret as ending the REPL session. -'f
Download (untitled) / with headers
text/plain 126b
Now a EOF (Ctrl+D) is answered with a newline, and the REPL exits. Closing without spectests, because the REPL isn't specced.
Download (untitled) / with headers
text/plain 331b
On Sat Oct 01 04:22:04 2011, moritz wrote: Show quoted text
> Now a EOF (Ctrl+D) is answered with a newline, and the REPL exits. > > Closing without spectests, because the REPL isn't specced.
As the original submitter, I'm reopening the ticket because only one of the two expected behaviours is observed. The newline is there, but not the "^D".
RT-Send-CC: perl6-compiler [...] perl.org
Download (untitled) / with headers
text/plain 446b
On Sat Oct 01 15:16:23 2011, masak wrote: Show quoted text
> On Sat Oct 01 04:22:04 2011, moritz wrote:
> > Now a EOF (Ctrl+D) is answered with a newline, and the REPL exits. > > > > Closing without spectests, because the REPL isn't specced.
> > As the original submitter, I'm reopening the ticket because only one of > the two expected behaviours is observed. The newline is there, but not > the "^D".
...and now, in 2013, we have neither "^D" nor newline.
Download (untitled) / with headers
text/plain 302b
None of the interpreters I tried (which include irb, python, python3, and ghci) show "^D" upon pressing Ctrl-D, so I don't think this is something the Perl 6 REPL should do. Whether it should print a newline or not is still a question, however (currently it doesn't, the other interpreters I tried do).
RT-Send-CC: perl6-compiler [...] perl.org
Download (untitled) / with headers
text/plain 626b
On Sat Jul 18 08:07:40 2015, lue wrote: Show quoted text
> None of the interpreters I tried (which include irb, python, python3, > and ghci) show "^D" upon pressing Ctrl-D, so I don't think this is > something the Perl 6 REPL should do. Whether it should print a newline > or not is still a question, however (currently it doesn't, the other > interpreters I tried do).
Here's my REPL today, first exiting with ^D. $ perl6 To exit type 'exit' or '^D' Show quoted text
> 2+20
22 Show quoted text
>
$ Then with exit: $ perl6 To exit type 'exit' or '^D' Show quoted text
> 3+4
7 Show quoted text
> exit
$ I think this meets the criteria of the original request. Closable with tests. -- Will "Coke" Coleda
Download (untitled) / with headers
text/plain 273b
Per http://irclog.perlgeek.de/perl6/2016-07-07#i_12800728, suggestion was to ask masak whether the ticket has been resolved. They responded that it has: http://irclog.perlgeek.de/perl6/2016-07-08#i_12806773 Tests added in https://github.com/perl6/roast/commit/dbb6a58a34
Download (untitled) / with headers
text/plain 428b
Fudging tests and reopening as the output actually differs on OSX: # Failed test 'stdout is correct' # at t/spec/S19-command-line/repl.t line 42 # expected: '/"To exit type 'exit' or '^D'\n> "/' # got: 'To exit type 'exit' or '^D' # ' # Looks like you failed 1 test of 2 not ok 5 - Pressing CTRL+D in REPL produces correct output on exit Tests fudged in https://github.com/perl6/roast/commit/5e25756c3f


This service is sponsored and maintained by Best Practical Solutions and runs on Perl.org infrastructure.

For issues related to this RT instance (aka "perlbug"), please contact perlbug-admin at perl.org