That method is *very* hackish, so I would suggest you not do it, but instead not use 'system' at all (Which, uses bash, so, yeah...), and look into the exec and friends system calls.
Also, I don't know if it might be of any help, but I found this. I'm not sure of the portability....?
By the way, if you want your shell to resize automatically, it should be possible by catching the SIGWINCH signal, like:
Code: Select all
#include <signal.h>
void catch(int num) {
printf("RESIZE\n");
}
int main() {
signal(SIGWINCH, catch);
for(;;);
}