Running things from x11 as a separate process

Discussion in 'Mac Programming' started by plamadude30k, May 6, 2008.

  1. plamadude30k macrumors newbie

    Joined:
    May 6, 2008
    #1
    In terminals, I'm used to the linux convention of being able to run several windows at once in the background. When I try this on x11 in leopard, nothing happens. I'm relatively experienced with the unix environment/x11 programming, but modding things about the environment itself is my biggest weakness.
    In case you don't know what I'm talking about, here's an example:

    I'm used to typing:

    ~> emacs/pico/vim/(insert favorite editor here) [filename] &

    and the editor opens the file in a separate window from my terminal, leaving me free to do things in the terminal, and edit the file. In OS X, I haven't gotten this to work. When I try this, all I get is:

    ~> emacs [filename] &
    [1] 11484 (sometimes different numbers)
    ~>

    and nothing else comes up on the screen. I know that there's a way around this and that it's probably stupidly simple, but I haven't figured it out on my own. In any replies, please be specific exactly what steps I should take to ameliorate this problem (e.g. say "edit the .bashrc file in your home directory to say xxxxxx after such and such line" instead of "add xxx to your bash file." Trust me, if I can, I will screw it up, and probably have).
    Thanks
     
  2. Trip.Tucker Guest

    Joined:
    Mar 13, 2008
    #2
    I'm confused. What are you expecting to see? You are being returned to the prompt. The process has spawned. What is the issue?
     
  3. lee1210 macrumors 68040

    lee1210

    Joined:
    Jan 10, 2005
    Location:
    Dallas, TX
    #3
    This would work fine if what you were launching spawned its own windows. gvim, xclock, stuff like that.

    If you run a command line app from a terminal, but put it in the background, it will stay there. I'm not familiar with a system by which the shell will launch a new xterm/aterm/etc. window and run the process you told it to background there in the foreground instead.

    You can manually run new xterms (X11 starts one automatically) by typing:
    xterm &
    at the prompt, or just
    cmd+N

    Then in the new window you could invoke your editor (NOT in the background though, leave off the &).

    -Lee
     
  4. plamadude30k thread starter macrumors newbie

    Joined:
    May 6, 2008
    #4
    well, the issue is that I'm returned to the prompt, but it seems that no process has been spawned. The prompt is still there, but no extra windows pop up with the editor/document.
     
  5. lee1210 macrumors 68040

    lee1210

    Joined:
    Jan 10, 2005
    Location:
    Dallas, TX
    #5
    You would need to be opening something that is graphical, which does start its own window. pico, emacs, vim, etc. are not graphical. They are command line tools. They do not open their own windows. They display in the terminal they are run from.

    emacs-X11 or gvim are examples of graphical editors which will open their own windows, so they would be appropriate to invoke in the manner you describe. Command line apps like emacs, vim, or gcc (for another example) should be run from the terminal you wish for them to use for display. As I mentioned above, there are means to get new xterms open to use if you like.

    -Lee

    P.S. The process HAS been spawned, but it is in the background. If you run:
    fg
    they will be brought to the foreground in that xterm.
     
  6. plamadude30k thread starter macrumors newbie

    Joined:
    May 6, 2008
    #6
    Ok, I do understand now, thanks very much for the help.
     

Share This Page