Back to Chezmoi

`stdinIsATTY`

assets/chezmoi.io/docs/reference/templates/functions/stdinIsATTY.md

2.70.2428 B
Original Source

stdinIsATTY

stdinIsATTY returns true if chezmoi's standard input is a TTY. It is primarily useful for determining whether prompt* functions should be called in a config file template or if a default value should be used instead.

!!! example

```
{{ $email := "" }}
{{ if stdinIsATTY }}
{{   $email = promptString "email" }}
{{ else }}
{{   $email = "[email protected]" }}
{{ end }}
```