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

MacのCLionで標準入力からEOFを送る

Last updated at Posted at 2018-02-22

環境

  • macOS 10.12.6
  • CLion 2017.3

結論

⌘+D を押す

※ショートカットはPreference->Keymapから変更可能

バグ?仕様?

vector<string> vec;
string buf;

while (cin >> buf)
    vec.push_back(buf);

for (auto s : vec)
    cout << s << endl;
a
b
c
^D

Process finished with exit code 0

コンソールで⌘+Dを押しても正常終了するが標準出力には表示されない?

解決方法

  • ⌘+Shift+A
  • Registry...
  • run.processes.with.ptyのチェックを外す
a
b
c
^D
a
b
c

Process finished with exit code 0

無事表示されるようになりました

参考

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