src.elv.sh@v0.21.0-dev.0.20240515223629-06979efb9a2a/pkg/edit/repl.d.elv (about)

     1  # A list of functions to call after each interactive command completes. There is one pre-defined
     2  # function used to populate the [`$edit:command-duration`](edit.html#$edit:command-duration)
     3  # variable. Each function is called with a single [map](https://elv.sh/ref/language.html#map)
     4  # argument containing the following keys:
     5  #
     6  # * `src`: Information about the source that was executed, same as what
     7  #   [`src`]() would output inside the code.
     8  #
     9  # * `duration`: A [floating-point number](https://elv.sh/ref/language.html#number) representing the
    10  # command execution duration in seconds.
    11  #
    12  # * `error`: An [exception](../ref/language.html#exception) object if the command terminated with
    13  # an exception, else [`$nil`](../ref/language.html#nil).
    14  #
    15  # See also [`$edit:command-duration`]().
    16  var after-command
    17  
    18  # Duration, in seconds, of the most recent interactive command. This can be useful in your prompt
    19  # to provide feedback on how long a command took to run. The initial value of this variable is the
    20  # time to evaluate your [`rc.elv`](command.html#rc-file) before printing the first prompt.
    21  #
    22  # See also [`$edit:after-command`]().
    23  var command-duration