I'm afraid there's no straight way to do so. You'll need to use rarun2
or radare's dd
command.
I prefer the rarun2 way, it is more flexible and simple.
From man rarun2
output:
Debugging a program redirecting io to another terminal
## open a new terminal and type 'tty' to get
$ tty ; clear ; sleep 999999
/dev/ttyS010
## in another terminal run r2
$ r2 -e dbg.profile=foo.rr2 -d ls
## or you can use -R option
$ r2 -R foo.rr2 -d ls
$ cat foo.rr2
#!/usr/bin/rarun2
stdio=/dev/ttys010
For a step-by-step guide and more detailed answer, check my answer to a similar question here.
dd
can be used to change file descriptors at runtime:
[0x00000000]> dd?
|Usage: dd Descriptors commands
| dd List file descriptors
| dd <file> Open and map that file into the UI
| dd-<fd> Close stdout fd
| dd* List file descriptors (in radare commands)
| dds <fd> <off> Seek given fd)
| ddd <fd1> <fd2> Dup2 from fd1 to fd2
| ddr <fd> <size> Read N bytes from fd
| ddw <fd> <hexpairs> Write N bytes to fd