Loading ...
Sorry, an error occurred while loading the content.
 

Re: alias issue

Expand Messages
  • Eugene Lee
    ... To test whether X11 is running or not, I have this bit in my ~/.bash_profile: if (ps -xc | grep -q X11) && [ -${DISPLAY}- = -- ] ; then export
    Message 1 of 4 , Nov 27, 2003
      On Thu, Nov 27, 2003 at 05:10:43PM +1300, James Tyson wrote:
      :
      : I have the following in my .bashrc to make sure that some settings are
      : set up when I log in on osx:
      :
      : if [ `uname` == "Darwin" ]; then
      : source /sw/bin/init.sh || true
      : if [ `ps auxww | grep -c /Appl\[i\]cations/X11.app` > 0 ]; then
      : if [ $TERM_PROGRAM == "Apple_Terminal" ]; then
      : export DISPLAY=:0.0
      : fi
      : if [ $TERM_PROGRAM == "iTerm.app" ]; then
      : export DISPLAY=:0.0
      : fi
      : fi
      : alias gvim="/Applications/vim/Vim.app/Contents/MacOS/Vim -g -o --"
      : fi

      To test whether X11 is running or not, I have this bit in my
      ~/.bash_profile:

      if (ps -xc | grep -q X11) && [ "-${DISPLAY}-" = "--" ] ; then
      export DISPLAY=:0.0
      fi

      Comment #1: my process check is a bit weak.

      Comment #2: my X11.app lives in /Applications/Utilities, which seems to
      be the new location with Panther and X11 v1.0.


      --
      Eugene Lee
      eugene at anime dot net
    • Benji Fisher
      ... That looks like setting up software provided by Fink. ... The DISPLAY environment variable is still a mystery to me. What is the point of these lines? ...
      Message 2 of 4 , Nov 28, 2003
        On Thu, Nov 27, 2003 at 05:10:43PM +1300, James Tyson wrote:
        > Hey folks.
        >
        > I have the following in my .bashrc to make sure that some settings are
        > set up when I log in on osx:
        >
        > if [ `uname` == "Darwin" ]; then
        > source /sw/bin/init.sh || true

        That looks like setting up software provided by Fink.

        > if [ `ps auxww | grep -c /Appl\[i\]cations/X11.app` > 0 ]; then
        > if [ $TERM_PROGRAM == "Apple_Terminal" ]; then
        > export DISPLAY=:0.0
        > fi
        > if [ $TERM_PROGRAM == "iTerm.app" ]; then
        > export DISPLAY=:0.0
        > fi
        > fi

        The DISPLAY environment variable is still a mystery to me. What is
        the point of these lines?

        > alias gvim="/Applications/vim/Vim.app/Contents/MacOS/Vim -g -o --"
        > fi
        >
        >
        > This all works really well except for the alias gvim line - when I
        > start vim using that gvim alias it no longer forks into the background.
        > Otherwise it works perfectly.
        >
        > Any ideas?

        Maybe the FAQ can help, here:

        http://macvim.swdev.org/OSX/#FAQ

        How do I start vim from Terminal?
        You can start the GUI version from a shell using the open command. (man
        open: fans of the NeXT will remember this one!)
        % open -a Vim
        % open -a Vim foo.txt
        You can also use this binary in a Terminal window. Change the path to
        vim/ as appropriate:
        % /Applications/vim/Vim.app/Contents/MacOS/Vim foo.txt
        Finally, you can start the GUI version the same way, adding the -g flag
        (and others if you like). Run it in the background if you want the shell
        to accept further input before quitting Vim.
        % /Applications/vim/Vim.app/Contents/MacOS/Vim -g +17 foo.txt &
        To make this simpler, I supply the gvim shell script in my distribution:
        % /Applications/vim/gvim +17 foo.txt
        does the same thing. (Thanks to Bram Moolenaar for the script.)

        HTH --Benji Fisher
      • Emily Jackson
        At 7:33 AM -0600 on Friday, November 28, 2003, Benji Fisher ... The DISPLAY variable has to be set in order to launch X11 programs from Terminal.app. I have in
        Message 3 of 4 , Nov 28, 2003
          At 7:33 AM -0600 on Friday, November 28, 2003, Benji Fisher
          <benji@...> wrote:

          >> if [ `ps auxww | grep -c /Appl\[i\]cations/X11.app` > 0 ]; then
          >> if [ $TERM_PROGRAM == "Apple_Terminal" ]; then
          >> export DISPLAY=:0.0
          >> fi
          >> if [ $TERM_PROGRAM == "iTerm.app" ]; then
          >> export DISPLAY=:0.0
          >> fi
          >> fi
          >
          > The DISPLAY environment variable is still a mystery to me. What is
          >the point of these lines?

          The DISPLAY variable has to be set in order to launch X11 programs from
          Terminal.app. I have in my .cshrc simply "setenv DISPLAY :0.0".

          Emily
        Your message has been successfully submitted and would be delivered to recipients shortly.