diff options
| author | sigoden <sigoden@gmail.com> | 2024-10-07 17:47:02 +0800 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-10-07 17:47:02 +0800 |
| commit | b3d31fd3d19b73caf41092e8f66e4263170bccf6 (patch) | |
| tree | 35751195c87f2ad674a8fd427adfedcfe670be70 /src | |
| parent | ea4c2131e40be1124110fe4203bd018a8018760c (diff) | |
| download | aichat-b3d31fd3d19b73caf41092e8f66e4263170bccf6.tar.gz | |
fix: unexpected REPL without tty (#911)
Diffstat (limited to 'src')
| -rw-r--r-- | src/main.rs | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/main.rs b/src/main.rs index 19e6e1b..1476408 100644 --- a/src/main.rs +++ b/src/main.rs @@ -151,7 +151,12 @@ async fn run(config: GlobalConfig, cli: Cli, text: Option<String>) -> Result<()> input.use_embeddings(abort_signal.clone()).await?; start_directive(&config, input, cli.code, abort_signal).await } - true => start_interactive(&config).await, + true => { + if !*IS_STDOUT_TERMINAL { + bail!("No TTY for REPL") + } + start_interactive(&config).await + } } } |
