From 22c8c3459f9583cd23098d76736f8af0fbbbeab3 Mon Sep 17 00:00:00 2001 From: Kevin Song Date: Tue, 13 Aug 2019 19:49:47 -0700 Subject: feat: implement `cmd_duration` for bash (#144) --- docs/config/README.md | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'docs') diff --git a/docs/config/README.md b/docs/config/README.md index 0c92e9361..e3d759fff 100644 --- a/docs/config/README.md +++ b/docs/config/README.md @@ -119,11 +119,16 @@ The `cmd_duration` module shows how long the last command took to execute. The module will be shown only if the command took longer than two seconds, or the `min_time` config value, if it exists. -::: warning NOTE -Command duration is currently not supported in `bash`. See -[this issue](https://github.com/starship/starship/issues/124) for more details. +::: warning Do Not Hook the DEBUG trap in Bash +If you are running Starship in `bash`, do not hook the `DEBUG` trap after running +`eval $(starship init $0)`, or this module **will** break. ::: +Bash users who need preexec-like functionality can use +[rcaloras's bash_preexec framework](https://github.com/rcaloras/bash-preexec). +Simply define the arrays `preexec_functions` and `precmd_functions` before +running `eval $(starship init $0)`, and then proceed as normal. + ### Options | Variable | Default | Description | -- cgit v1.2.3