Symbolic link Directory git highlight issue and other issue on atom shell command


#1

Modified code
$ vim /Applications/Atom.app/Contents/Resources/app/atom.sh

#!/bin/sh                                                                                                                                                                                                                                                                                                                                                                   
ATOM_PATH=${ATOM_PATH-/Applications/Atom.app}
ATOM_BINARY=$ATOM_PATH/Contents/MacOS/Atom

if [ ! -d $ATOM_PATH ]; then sleep 5; fi # Wait for Atom to reappear, Sparkle may be replacing it.

if [ ! -d $ATOM_PATH ]; then
  echo "Atom application not found at '$ATOM_PATH'" >&2
  exit 1
fi

while getopts ":wtfvhs-:" opt; do
  case "$opt" in
    -)
      case "${OPTARG}" in
        wait)
          WAIT=1
          ;;
        help|version|foreground|test)
          EXPECT_OUTPUT=1
          ;;
      esac
      ;;
    w)
      WAIT=1
      ;;
    h|v|f|t)
      EXPECT_OUTPUT=1
      ;;
  esac
done

if [ $EXPECT_OUTPUT ]; then
  $ATOM_BINARY --executed-from="$(pwd -P)" --pid=$$ $@
  exit $?
else
  open -a $ATOM_PATH -n --args --executed-from="$(pwd -P)" --pid=$$ $@
fi

# Used to exit process when atom is used as $EDITOR
on_die() {
  exit 0
}
trap 'on_die' SIGQUIT SIGTERM

if [ $WAIT ]; then
  while true; do
    sleep 1
  done
fi

diff

dongri% diff atom_old.sh atom.sh                                                                                                                                                                                                                                                                                                                               34c34
<   $ATOM_BINARY --executed-from="$(pwd)" --pid=$$ $@
---
>   $ATOM_BINARY --executed-from="$(pwd -P)" --pid=$$ $@
37c37
<   open -a $ATOM_PATH -n --args --executed-from="$(pwd)" --pid=$$ $@
---
>   open -a $ATOM_PATH -n --args --executed-from="$(pwd -P)" --pid=$$ $@
dongri%  

#2

Hey @dongri! Thanks for this!


#3

We are trying to reproduce the bugs that symlinks were causing. @dongri can you give us an example of a bug this fixes?


#4

Hi @ProbablyCorey

% mkdir a
% ln -s a b

Start project a from atom command

% cd a
% atom .

Start project b from atom command

% cd b
% atom .

Project a can be the highlight of git status, but the highlight of the git status is invalid project b.


#5

@ProbablyCorey I have this exact same issue btw. Organise application source code into directories by supplying symlinks to them, however when I view the symlinked directories I lose the color formatting that is shown in dongri’s screenshots. I also lose “Reveal in Tree View” functionality when right clicking on a file in one of these symlinked directories.


#6

Do you have the “Follow Symlinks” setting enabled?


#7

Yup, I’ve never altered that setting and it’s enabled by default.


#8

June 2016 and this issue lives on.