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

Closed
p6rt opened this issue Nov 6, 2009 · 19 comments
Closed

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

p6rt opened this issue Nov 6, 2009 · 19 comments

Comments

@p6rt
Copy link

p6rt commented Nov 6, 2009

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

Searchable as RT70297$

@p6rt
Copy link
Author

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
Copy link
Author

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
Copy link
Author

p6rt commented Nov 6, 2009

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

@p6rt
Copy link
Author

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
Copy link
Author

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
Copy link
Author

p6rt commented Oct 1, 2011

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

@p6rt
Copy link
Author

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
Copy link
Author

p6rt commented Oct 1, 2011

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

@p6rt
Copy link
Author

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
Copy link
Author

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
Copy link
Author

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
Copy link
Author

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 Raku/roast@dbb6a58a34

@p6rt
Copy link
Author

p6rt commented Jul 8, 2016

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

@p6rt
Copy link
Author

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 Raku/roast@5e25756c3f

@p6rt
Copy link
Author

p6rt commented Jul 9, 2016

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

@JJ
Copy link

JJ commented May 6, 2020

Can someone confirm this test still fails on OSX?

@coke
Copy link

coke commented May 6, 2020

$ raku --version
This is Rakudo version 2020.01-247-gcdbd60c1c built on MoarVM version 2020.01.1-43-ga71eee4c2
implementing Raku 6.d.
$ prove -v -e raku t/spec/S19-command-line/repl.t
t/spec/S19-command-line/repl.t ..
1..1
ok 1 - exit(42) in executed REPL got run
ok
All tests successful.
Files=1, Tests=1,  0 wallclock secs ( 0.02 usr  0.01 sys +  0.69 cusr  0.12 csys =  0.84 CPU)
Result: PASS
$ sw_vers
ProductName:	Mac OS X
ProductVersion:	10.15.3
BuildVersion:	19D76

@JJ
Copy link

JJ commented May 6, 2020

So, can we safely close it? Is it properly addressed?

@JJ
Copy link

JJ commented Dec 29, 2020

Closing it too, since it's been addressed in OSX, as proved by @coke

@JJ JJ closed this as completed Dec 29, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants