help with isatty command in C

if i run this
execl("/bin/sh", "/bin/sh", "-c", "ls", NULL);

i get the output to be like
___
___
___
etc

but there is a way using the command -C to force it to print like
___ ___ ___ ___ etc
how do i use the -C in the execl command?

parse the output with popen()

without using that, and using -C is there any way?

isatty never lies. The only way to make it say something's a terminal is to give it a terminal. If you can't or won't give it the terminal you started with, you have to create a new one, a virtual terminal. this is an example showing how to do so. You have to compile it with -lutil.