add command time duration plugin (#1683)

This commit is contained in:
BarbUk
2020-12-27 17:48:17 +01:00
committed by GitHub
parent b119540ce7
commit 13e795c995
7 changed files with 131 additions and 4 deletions

View File

@@ -38,6 +38,7 @@ Default theme glyphs
BARBUK_SVN_CHAR='⑆ '
BARBUK_EXIT_CODE_ICON=' '
BARBUK_PYTHON_VENV_CHAR=' '
BARBUK_COMMAND_DURATION_ICON='  '
Customize glyphs
^^^^^^^^^^^^^^^^
@@ -92,6 +93,11 @@ Please refer to the following documentation for more information:
EOF
chmod 400 /etc/sudoers.d/keepenv
Command duration
----------------
See :ref:`Command duration <command_duration>`.
Examples
--------
@@ -122,3 +128,11 @@ Python venv
.. code-block:: bash
  flask ~/test on  master ✓
Command duration
^^^^^^^^^^^^^^^^
.. code-block:: bash
# sleep 3s
user@hostname in  ~/bash-it on  master ✓  3.2s

View File

@@ -37,6 +37,29 @@ See :ref:`here <list_of_themes>`.
Theme Switches & Variables
^^^^^^^^^^^^^^^^^^^^^^^^^^
.. _command_duration:
Command duration
================
Prints last command duration
Usage
#####
Command duration can be enabled by exporting ``BASH_IT_COMMAND_DURATION``:
.. code-block:: bash
export BASH_IT_COMMAND_DURATION=true
The default configuration display last command duration for command lasting one second or more.
You can customize the minimum time in seconds before command duration is displayed in your ``.bashrc``:
.. code-block:: bash
export COMMAND_DURATION_MIN_SECONDS=5
Clock Related
=============