LoginSignup
1

More than 5 years have passed since last update.

Atomのterm3でログイン後にログイン前のカレントディレクトリに自動で移動する

Last updated at Posted at 2016-01-30

atomでterm3を使ってみる事にしたんですが、起動時にlogin -f "username"するとホームに戻ってしまうので起動後に自動でログイン前のカレントディレクトリに移したくなりました。
その時にやった事のメモです。

  1. Term3の環境設定のAuto Run Commandで以下を入力します。
    echo $PWD > /tmp/term3pwd && login -f "username"

  2. .bash_profileに以下を追加

cdterm3 () {
  if [[ -e /tmp/term3pwd ]]
  then
    cd $(cat /tmp/term3pwd)
    rm /tmp/term3pwd
  fi
}
cdterm3

これで起動時にログイン前のカレントに移動するはず。
まぁ、これでいいか

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1