Skip to content

Commit

Permalink
Merge pull request #586 from jolicode/deprecation
Browse files Browse the repository at this point in the history
Fix depraction in in doc about run()
  • Loading branch information
pyrech authored Nov 28, 2024
2 parents ba22a02 + 7ae08b3 commit 099c6c7
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions doc/getting-started/run.md
Original file line number Diff line number Diff line change
Expand Up @@ -154,30 +154,32 @@ do that by setting the `tty` option to `true`:
use Castor\Attribute\AsTask;

use function Castor\run;
use function Castor\context;

#[AsTask()]
function foo(): void
{
run('echo "bar"', tty: true);
run('echo "bar"', context: context()->withTty(true));
}
```

> [!WARNING]
> When using a TTY, the output of the command is empty in the process object
> (when using `getOutput()` or `getErrorOutput()`).
You can also disable the pty by setting the `pty` option to `false`. If `pty`
You can also disable the PTY by setting the `pty` option to `false`. If `pty`
and `tty` are both set to `false`, the standard input will not be forwarded to
the process:

```php
use Castor\Attribute\AsTask;

use function Castor\run;
use function Castor\context;

#[AsTask()]
function foo(): void
{
run('echo "bar"', pty: false);
run('echo "bar"', context: context()->withPty(false));
}
```

0 comments on commit 099c6c7

Please sign in to comment.