@@ -1422,10 +1422,80 @@ ends_with_semicolon(code::AbstractString) = ends_with_semicolon(String(code))
14221422ends_with_semicolon (code:: Union{String,SubString{String}} ) =
14231423 contains (_rm_strings_and_comments (code), r" ;\s *$" )
14241424
1425+ function banner (io:: IO = stdout ; short = false )
1426+ if Base. GIT_VERSION_INFO. tagged_commit
1427+ commit_string = Base. TAGGED_RELEASE_BANNER
1428+ elseif isempty (Base. GIT_VERSION_INFO. commit)
1429+ commit_string = " "
1430+ else
1431+ days = Int (floor ((ccall (:jl_clock_now , Float64, ()) - Base. GIT_VERSION_INFO. fork_master_timestamp) / (60 * 60 * 24 )))
1432+ days = max (0 , days)
1433+ unit = days == 1 ? " day" : " days"
1434+ distance = Base. GIT_VERSION_INFO. fork_master_distance
1435+ commit = Base. GIT_VERSION_INFO. commit_short
1436+
1437+ if distance == 0
1438+ commit_string = " Commit $(commit) ($(days) $(unit) old master)"
1439+ else
1440+ branch = Base. GIT_VERSION_INFO. branch
1441+ commit_string = " $(branch) /$(commit) (fork: $(distance) commits, $(days) $(unit) )"
1442+ end
1443+ end
1444+
1445+ commit_date = isempty (Base. GIT_VERSION_INFO. date_string) ? " " : " ($(split (Base. GIT_VERSION_INFO. date_string)[1 ]) )"
1446+
1447+ if get (io, :color , false ):: Bool
1448+ c = Base. text_colors
1449+ tx = c[:normal ] # text
1450+ jl = c[:normal ] # julia
1451+ d1 = c[:bold ] * c[:blue ] # first dot
1452+ d2 = c[:bold ] * c[:red ] # second dot
1453+ d3 = c[:bold ] * c[:green ] # third dot
1454+ d4 = c[:bold ] * c[:magenta ] # fourth dot
1455+
1456+ if short
1457+ print (io,"""
1458+ $(d3) o$(tx) | Version $(VERSION )$(commit_date)
1459+ $(d2) o$(tx) $(d4) o$(tx) | $(commit_string)
1460+ """ )
1461+ else
1462+ print (io,""" $(d3) _$(tx)
1463+ $(d1) _$(tx) $(jl) _$(tx) $(d2) _$(d3) (_)$(d4) _$(tx) | Documentation: https://docs.julialang.org
1464+ $(d1) (_)$(jl) | $(d2) (_)$(tx) $(d4) (_)$(tx) |
1465+ $(jl) _ _ _| |_ __ _$(tx) | Type \" ?\" for help, \" ]?\" for Pkg help.
1466+ $(jl) | | | | | | |/ _` |$(tx) |
1467+ $(jl) | | |_| | | | (_| |$(tx) | Version $(VERSION )$(commit_date)
1468+ $(jl) _/ |\\ __'_|_|_|\\ __'_|$(tx) | $(commit_string)
1469+ $(jl) |__/$(tx) |
1470+
1471+ """ )
1472+ end
1473+ else
1474+ if short
1475+ print (io,"""
1476+ o | Version $(VERSION )$(commit_date)
1477+ o o | $(commit_string)
1478+ """ )
1479+ else
1480+ print (io,"""
1481+ _
1482+ _ _ _(_)_ | Documentation: https://docs.julialang.org
1483+ (_) | (_) (_) |
1484+ _ _ _| |_ __ _ | Type \" ?\" for help, \" ]?\" for Pkg help.
1485+ | | | | | | |/ _` | |
1486+ | | |_| | | | (_| | | Version $(VERSION )$(commit_date)
1487+ _/ |\\ __'_|_|_|\\ __'_| | $(commit_string)
1488+ |__/ |
1489+
1490+ """ )
1491+ end
1492+ end
1493+ end
1494+
14251495function run_frontend (repl:: StreamREPL , backend:: REPLBackendRef )
14261496 repl. frontend_task = current_task ()
14271497 have_color = hascolor (repl)
1428- Base . banner (repl. stream)
1498+ banner (repl. stream)
14291499 d = REPLDisplay (repl)
14301500 dopushdisplay = ! in (d,Base. Multimedia. displays)
14311501 dopushdisplay && pushdisplay (d)
0 commit comments