mirror of
https://github.com/starship/starship.git
synced 2026-06-23 02:05:51 +07:00
feat: implement timer module (#118)
Implement a timer module that takes a commandline argument, the number of seconds the last job took to complete, and displays it if appropriate. Alters shell initialization files to compute this number using date +%s where needed. Adds a config section to configure minimum amount of time before timer is shown (default is 2s)
This commit is contained in:
committed by
Matan Kushner
parent
b2303d5d8e
commit
3daf3ddf26
@@ -109,6 +109,33 @@ command had an unsuccessful status code (non-zero).
|
||||
symbol = "❯"
|
||||
```
|
||||
|
||||
## Command Duration
|
||||
|
||||
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.
|
||||
:::
|
||||
|
||||
### Options
|
||||
|
||||
| Variable | Default | Description |
|
||||
| ---------- | ------- | ----------------------------------- |
|
||||
| `min_time` | `2` | Shortest duration to show time for. |
|
||||
| `disabled` | `false` | Disables the `cmd_duration` module. |
|
||||
|
||||
### Example
|
||||
|
||||
```toml
|
||||
# ~/.config/starship.toml
|
||||
|
||||
[cmd_duration]
|
||||
min_time = 4
|
||||
```
|
||||
|
||||
## Directory
|
||||
|
||||
The `directory` module shows the path to your current directory, truncated to
|
||||
@@ -366,3 +393,4 @@ The module will be shown if any of the following conditions are met:
|
||||
[username]
|
||||
disabled = true
|
||||
```
|
||||
|
||||
|
||||
Reference in New Issue
Block a user