Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

No explicit ^D and no newline after ^D in the REPL in Rakudo #1393

Open
p6rt opened this issue Nov 6, 2009 · 15 comments
Open

No explicit ^D and no newline after ^D in the REPL in Rakudo #1393

p6rt opened this issue Nov 6, 2009 · 15 comments

Comments

@p6rt
Copy link

@p6rt p6rt commented Nov 6, 2009

Migrated from rt.perl.org#70297 (status was 'open')

Searchable as RT70297$

@p6rt

This comment has been minimized.

Copy link
Author

@p6rt p6rt commented Nov 6, 2009

From @masak

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.

@p6rt

This comment has been minimized.

Copy link
Author

@p6rt p6rt commented Nov 6, 2009

From @coke

On Fri, Nov 6, 2009 at 11​:50 AM, Carl Mäsak
<perl6-bugs-followup@​perl.org> wrote​:

# 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

@p6rt

This comment has been minimized.

Copy link
Author

@p6rt p6rt commented Nov 6, 2009

The RT System itself - Status changed from 'new' to 'open'

@p6rt

This comment has been minimized.

Copy link
Author

@p6rt p6rt commented Nov 6, 2009

From @japhb

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

@p6rt

This comment has been minimized.

Copy link
Author

@p6rt p6rt commented Oct 1, 2011

From @moritz

Now a EOF (Ctrl+D) is answered with a newline, and the REPL exits.

Closing without spectests, because the REPL isn't specced.

@p6rt

This comment has been minimized.

Copy link
Author

@p6rt p6rt commented Oct 1, 2011

@moritz - Status changed from 'open' to 'resolved'

@p6rt

This comment has been minimized.

Copy link
Author

@p6rt p6rt commented Oct 1, 2011

From @masak

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".

@p6rt

This comment has been minimized.

Copy link
Author

@p6rt p6rt commented Oct 1, 2011

@masak - Status changed from 'resolved' to 'open'

@p6rt

This comment has been minimized.

Copy link
Author

@p6rt p6rt commented Jan 22, 2013

From @masak

On Sat Oct 01 15​:16​:23 2011, masak wrote​:

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.

@p6rt

This comment has been minimized.

Copy link
Author

@p6rt p6rt commented Jul 18, 2015

From @ShimmerFairy

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).

@p6rt

This comment has been minimized.

Copy link
Author

@p6rt p6rt commented May 10, 2016

From @coke

On Sat Jul 18 08​:07​:40 2015, lue wrote​:

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'

2+20
22

$

Then with exit​:

$ perl6
To exit type 'exit' or '^D'

3+4
7
exit
$

I think this meets the criteria of the original request. Closable with tests.

--
Will "Coke" Coleda

@p6rt

This comment has been minimized.

Copy link
Author

@p6rt p6rt commented Jul 8, 2016

From @zoffixznet

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 perl6/roast@dbb6a58

@p6rt

This comment has been minimized.

Copy link
Author

@p6rt p6rt commented Jul 8, 2016

@zoffixznet - Status changed from 'open' to 'resolved'

@p6rt

This comment has been minimized.

Copy link
Author

@p6rt p6rt commented Jul 9, 2016

From @zoffixznet

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 perl6/roast@5e25756

@p6rt

This comment has been minimized.

Copy link
Author

@p6rt p6rt commented Jul 9, 2016

@zoffixznet - Status changed from 'resolved' to 'open'

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
1 participant
You can’t perform that action at this time.