0

Let's say I'm running xterm or some other terminal emulator on top of some graphical X Window Environment. xterm on KDE, for example. I want to write an application that may be called on the command line of one terminal emulator, and upon execution, the application creates a new KDE/Environment window, separate from the current terminal emulator, and on that new window run an Ncurses context for application purposes.

How would I do this? Is this terminal emulator dependent? Desktop environment dependent? Would I be using bare X window system calls?

Druid
  • 133
  • 3
  • 12

1 Answers1

0

It's terminal (emulator) dependent.

Curses runs in terminals and terminal emulators. Most of the latter (terminal emulators) have some way to tell what program (other than your shell) to run in the terminal emulator.

For instance, xterm can be told using the -e option,

   -e program [ arguments ... ]
           This option specifies the program (and its command line
           arguments) to be run in the xterm window.  It also sets the
           window title and icon name to be the basename of the program
           being executed if neither -T nor -n are given on the command
           line.

           NOTE: This must be the last option on the command line.

letting you start an xterm running MyApplication like this:

xterm -e MyApplication

Again, most of the terminal emulators you might run in X accept that option. KDE konsole does that. There's no manual, but

konsole --help-all

shows it at the end.

Thomas Dickey
  • 51,086
  • 7
  • 70
  • 105