main: only merge stdout and control token if not in conversation or grammar mode
This commit is contained in:
parent
5032f18f20
commit
90456a5717
1 changed files with 4 additions and 3 deletions
|
@ -531,9 +531,10 @@ int main(int argc, char ** argv) {
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifndef _MSC_VER
|
#ifndef _MSC_VER
|
||||||
if (fcntl(CONTROL_TOKEN_FILENO, F_GETFL) == -1) {
|
const bool control_token_descriptor_is_attached = fcntl(CONTROL_TOKEN_FILENO, F_GETFL) != -1;
|
||||||
// Control Token File Descriptor has nothing attached to it
|
if (!control_token_descriptor_is_attached && !params.conversation && sparams.grammar.empty()) {
|
||||||
// make control token file descriptor be an alias of stdout
|
// Control Token File Descriptor has nothing attached to it so make control token file descriptor be an alias of stdout
|
||||||
|
// This is not done however if we are in conversation mode or grammar mode as that is typically discarded
|
||||||
dup2(STDOUT_FILENO, CONTROL_TOKEN_FILENO);
|
dup2(STDOUT_FILENO, CONTROL_TOKEN_FILENO);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue