2
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

Windows で atom . ができない対策

Posted at

概要

Windows のコマンドプロンプトで atom . としても Atom がカレントディレクトリーで開かない。

これを簡易的(対症療法的)に解決した。

現象

対象:Windows の Atom 1.40.0 およびその少し前のバージョン

コマンドプロンプトで

atom .

と打ったら,カレントディレクトリーをプロジェクトディレクトリーとして Atom が起動するはずだ。
実際,Atom を使い始めてから長らくそうであった。

ところが,最近,カレントディレクトリーではなく,Atom のインストールディレクトリーをプロジェクトディレクトリーとして Atom が起動するようになった。

すべての Windows 版 Atom でそうなのか,私の環境で何か異変が起こったのかは分からない。
ウェブ検索しても何も出てこないので,何か特殊な再現条件があるのかもしれない。

解決

Windows では %cd% がカレントディレクトリーのパスになるらしいので,

atom %cd%

と打ったらうまくいった。大文字/小文字は区別されないので,%CD% でもいい。

%CD% は「動的な環境変数」と呼ばれるものの一つで,カレントディレクトリーのパスを表す文字列に展開されるらしい。

しかし,もう少し打ちやすいようにできないか。Shift キーを使わなくていいように。
ええと,パスが通ったディレクトリーに

atomhere.bat
atom %CD%

というバッチファイルを置けばいいのか。
これで atomhere と打つだけでよくなった。
(うーん,名前がイマイチ。もう少し短く分かりやすい名前はないものか)

2
0
0

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
2
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?