Skip to content

Commit 42b2b19

Browse files
committed
Add readlines() to commandline_hello to keep terminal open on Windows
1 parent 8e605dd commit 42b2b19

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

examples/commandline_hello.jl

+7-2
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,12 @@
22
# Build this with the `commandline_app=true` flag in `BuildApp.build_app_bundle`.
33

44
Base.@ccallable function julia_main(ARGS::Vector{String})::Cint
5-
println("Oh hi, World!")
6-
println("Current working directory: $(pwd())")
5+
println("Hi what's your name?")
6+
name = readline()
7+
println("Oh hi, $name\! It's a pleasure to meet you.")
8+
println("By the way, here's the current working directory:\n'$(pwd())'")
9+
10+
println("\nGoodbye! (Press enter to exit)")
11+
readline()
712
return 0
813
end

0 commit comments

Comments
 (0)