You are not logged in.
Hi!
Is there a way to call vfork() and then execl a system program (/usr/bin/nano for example) in a specific ncurses window and not stdscr? I'd like to achieve that, having 2 subwin of stdscr, nano will be launched in the first, but the second window will stay untouched. So you can open 2 files in the same time in 2 different windows.
Is there a way? I tried googling but couldn't find anything.
Thanks everyone!
Offline
There is a way to do this, but I don't know that it can be done with just the tools you describe. You need a pseudo terminal set up in the ncurses window. The ncurses window only provides a space on which to draw, it doesn't provide a new terminal - but a pty can do this. You might want to check out the code of screen/tmux/dvtm (the last might have the simplest code as the first two have lots of other features).
EDIT: vt_forkpty on line 1564 of vt.c in the dvtm-git code would probably be the key.
Last edited by Trilby (2015-03-23 11:59:27)
"UNIX is simple and coherent" - Dennis Ritchie; "GNU's Not Unix" - Richard Stallman
Offline
Mmmh thanks to you i might have found that http://www.gnu.org/software/libc/manual … Pairs.html (forkpty) should be what i'm looking for.
I'll try and report back here, possibly with a little code snippet for future people.
Again, thanks for your hint!
Last edited by nierro (2015-03-23 12:22:28)
Offline