Skip to content

feat: Set $ION_CMD_DURATION variable after each command

BuggStream requested to merge BuggStream/ion:add-cmd-duration into master

Description

Set the $ION_CMD_DURATION variable after each command is executed

The variable is equal to the amount of WHOLE seconds spent executing the previous command.

This variable is currently not set when running the PROMPT function, because this would mean that the ION_CMD_DURATION would always refer to the time spent in the PROMPT function when running in interactive mode.

Reason for this feature

This feature was needed in order to properly support the cmd-duration of starship. Besides this it could be a useful feature for other purposes too.

Testing

Currently I have written no additional tests, since the methods I changed (on_command and command) don't seem to have any tests that actually test their functionality currently. (Perhaps there are, but I couldn't find them)

Merge request reports