 CONSTANT: HISTORY V{ }
 CONSTANT: LINKS V{ }
 CONSTANT: STACK V{ }
+CONSTANT: PAGE V{ }
 CONSTANT: URL V{ }
 
 : add-stack ( args -- )
+    dup PAGE keys index [ STACK delete-all ] unless
     URL ?first STACK index [
         1 + dup STACK ?nth pick = [
             2drop

        { abbrevs { "l" } } }
    T{ command
        { name "ls" }
        { quot [ drop gemini-ls ] }
        { help "List the currently available links." }
        { abbrevs f } }
    T{ command

! Copyright (C) 2021 John Benediktsson
! See http://factorcode.org/license.txt for BSD license

USING: accessors arrays assocs combinators
combinators.short-circuit command-loop formatting gemini
gemini.private io io.directories io.encodings.string
io.encodings.utf8 io.files io.files.temp io.launcher io.pipes
kernel math math.parser namespaces present sequences splitting
system urls webbrowser ;

IN: gemini.cli

