Skip to content

Commit d0110af

Browse files
committed
Multiple banner sizes
1 parent 31b7a12 commit d0110af

File tree

1 file changed

+51
-10
lines changed

1 file changed

+51
-10
lines changed

base/client.jl

Lines changed: 51 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -438,16 +438,57 @@ function banner(io::IO = stdout)
438438
doclink = S"{bold:Documentation:} {(underline=grey),link={https://docs.julialang.org}:https://docs.julialang.org}"
439439
help = S"Type {region,julia_help_prompt:?} for help, {region,julia_pkg_prompt:]?} for {(underline=grey),link={https://pkgdocs.julialang.org/}:Pkg} help."
440440

441-
print(io, S"""
442-
{bold,green:_}
443-
{bold,blue:_} _ {bold:{red:_}{green:(_)}{magenta:_}} {shadow:│} $doclink
444-
{bold,blue:(_)} | {bold:{red:(_)} {magenta:(_)}} {shadow:│}
445-
_ _ _| |_ __ _ {shadow:│} $help
446-
| | | | | | |/ _` | {shadow:│}
447-
| | |_| | | | (_| | {shadow:│} Version {bold:$VERSION}$commit_date
448-
_/ |\\__'_|_|_|\\__'_| {shadow:│} $commit_string
449-
|__/ {shadow:│}
450-
\n""")
441+
if all(displaysize(io) .>= (20, 70)) # Full size
442+
print(io, S"""
443+
{bold,green:_}
444+
{bold,blue:_} _ {bold:{red:_}{green:(_)}{magenta:_}} {shadow:│} $doclink
445+
{bold,blue:(_)} | {bold:{red:(_)} {magenta:(_)}} {shadow:│}
446+
_ _ _| |_ __ _ {shadow:│} $help
447+
| | | | | | |/ _` | {shadow:│}
448+
| | |_| | | | (_| | {shadow:│} Version {bold:$VERSION}$commit_date
449+
_/ |\\__'_|_|_|\\__'_| {shadow:│} $commit_string
450+
|__/ {shadow:│}
451+
\n""")
452+
elseif all(displaysize(io) .>= (15, 70)) # Shorter
453+
print(io, S"""
454+
{bold,green:_}
455+
{bold,blue:_} _ {bold:{red:_}{green:(_)}{magenta:_}} {shadow:│} $doclink
456+
{bold,blue:(_)} _ _ | |{bold:{red:(_)} {magenta:(_)}}_ {shadow:│} $help
457+
| || || || || |/ _` | {shadow:│}
458+
_/ | \\_._||_||_|\\__/_| {shadow:│} Version {bold:$VERSION}$commit_date
459+
|__/ {shadow:│} $commit_string
460+
\n""")
461+
elseif all(displaysize(io) .>= (25, 45)) # Narrower
462+
print(io, S"""
463+
{bold,green:_}
464+
{bold,blue:_} _ {bold:{red:_}{green:(_)}{magenta:_}}
465+
{bold,blue:(_)} _ _ | |{bold:{red:(_)} {magenta:(_)}}_
466+
| || || || || |/ _` |
467+
_/ | \\_._||_||_|\\__/_|
468+
|__/
469+
470+
$doclink
471+
$help
472+
473+
Version {bold:$VERSION}$commit_date
474+
$commit_string
475+
\n""")
476+
elseif all(displaysize(io) .>= (8, 55)) # Tiny
477+
print(io, S"""
478+
{bold,blue:o} ╷{green:∴} {shadow:│} $doclink
479+
│╷ ╷││╭─┐ {shadow:│} Version {bold:$VERSION}$commit_date
480+
│╰─┘╵╵╰─╰ {shadow:│} $commit_string
481+
482+
""")
483+
elseif all(displaysize(io) .>= (5, 25)) # Tinier
484+
print(io, S"""
485+
{bold,blue:o} |{green:∴} _
486+
||_|||(_|
487+
╯{grey:{bold:$VERSION}$commit_date}
488+
\n""")
489+
else # Text only
490+
print(io, S"""{bold:{blue:∴} {magenta:Julia} $VERSION}$commit_date\n""")
491+
end
451492
end
452493

453494
global active_repl

0 commit comments

Comments
 (0)