Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Howto Exit swift-language terminal mode

Tags:

macos

swift

I'm having problems about how to exit the swift-language's terminal mode. I type swift in terminal on my Mac Air (Yosemite), And I got to swift's terminal mode,, something similar to python's.

But in python i can use quit() to exit that mode. However, in swift,, I didn't find such a method..

So I exit the whole terminal by 'command + q'..

Then, I got gabbage like these:

      20282   0.0  0.0        0      0   ??  Z     8:14PM   0:00.00 (repl_swift)
      20372   0.0  0.0  2441988    652 s000  S+    8:30PM   0:00.00 grep swift
      20168   0.0  0.0        0      0   ??  Z     8:00PM   0:00.00 (repl_swift)

What's worse,,, even kill -9 can't kill the repl_swift process.

I guess the only thing I can do is reboot now.. But really curious why~~ Is the swift-terminal mode still in beta version? :)

like image 709
Jilin Xie Avatar asked Sep 10 '25 15:09

Jilin Xie


1 Answers

Type control-d to exit REPL.

control-d is the end of file character and it's used by various command line tools to mark the end of user input.


Added by a later editor

You can also quit the Swift REPL by typing :quit, :q, or :exit

like image 164
Jeffery Thomas Avatar answered Sep 12 '25 13:09

Jeffery Thomas