Comments (19)
おそらく、何らかの原因でエラーメッセージが出力されない状態になっているのだと思います。
Windowsだとパイプ接続になるため、そこが原因となることもありえます。
同じコマンドをvimshellから実行するとどうなるでしょうか。
from vimproc.vim.
Ubuntu Linux環境で試して見ました。動作することを確認。
やはりWindows限定の不具合でしょう。となると、vimproc側で対処するのは難しいです。
おそらく、jsxが接続先をパイプかどうか判別しています。
vimprocを用いるとパイプ接続になるため、エラーメッセージが出ないのでしょう。
from vimproc.vim.
ご確認ありがとうございます。
vimshell で試してみたところ正しい値が出力されました。
from vimproc.vim.
vimshellで動いた、というのはWindows環境ですか?
うーん、Windowsだとvimshellもパイプ接続になりほとんど動作が変わらないはずなんですが……
from vimproc.vim.
はい、そうです。
上記テストは全て Windows 環境になります。
from vimproc.vim.
となると、vimproc側でも対処のしようがあるという事ですかね?
とはいえ、私はWindows環境にJSXを用意していないので、動作検証がかなり大変そうです。
osyo_mangaさんの方でもvimprocのソースコードを調べてもらえるとかなり助かります。
from vimproc.vim.
他の人の環境でも再現しないようであれば、わたしの方で原因を調べるのが早そうですね。
手が空いた時にでももうちょっと詳しく調べてみたいと思います。
from vimproc.vim.
私も調べてみる予定ですが、おそらく時間がかかります。
osyo-mangaさんの方でも引き続き調査をお願いいたします。
from vimproc.vim.
私の環境でJSXが入りませんでした。どうやら、インストールされるパッケージがJSXの要求するバージョンと合わない。
gemみたいに複数のバージョンをインストールできるわけではないし……。
インストーラに苦しめられるとは思いませんでしたね。
というわけで、しばらくこっちでは試すことができません。
from vimproc.vim.
ふむ、なるほど。
了解しました。
from vimproc.vim.
これは jsx が process.exit(0)
してるからです。exit(0) すると console.log() がバッファリングした内容を貯めたまま終了するので、コンソールの様にパイプでない出力先に対しては有効ですが、パイプに対しては途中で切れてしまう結果となります。(windowsの場合)
ここでjsxは
- process.exit(0)している
- console.log()を使っている
という動作になっているのですが、console.log() を process.stdout.write に、process.exit(0) を return 0 に変えると、正しく表示されます。
from vimproc.vim.
これってWIndows特有の問題ですか?
OSXでも古いnodejsはこのバグがあるようです。実行しているのはどのバージョンでしょう?
0.8.0でも再現しますか?
0.8.0で再現しないなら、特に対処はしません。0.8.0でも再現するなら何らかの対処をしたいと思います。
from vimproc.vim.
Sorry about I'm writing this comment in english so that github don't
allow japanese e-mails.
Please don't mind and keep to comment in japanese. btw, it's very hard
to write english text by my handy phone. :(
I reproduced this on version 0.8.0 .
And I could solved this issue with changing like above. Currentry, I
can't read node help file, so I'm not sure, process.stdout may have
functions or methods something like flush.
On 7/4/12, Fuji, Goro
[email protected]
wrote:
�$B$3$l$C$F�(BWIndows�$BFCM-$NLdBj$G$9$+!)�(B
OSX�$B$G$b8E$$�(Bnodejs�$B$O$3$N%P%0$,$"$k$h$&$G$9!#<B9T$7$F$$$k$N$O$I$N%P!<%8%g%s$G$7$g$&!)�(B
0.8.0�$B$G$b:F8=$7$^$9$+!)�(B0.8.0�$B$G:F8=$7$J$$$J$i!"FC$KBP=h$O$7$^$;$s!#�(B0.8.0�$B$G$b:F8=$9$k$J$i2?$i$+$NBP=h$r$7$?$$$H;W$$$^$9!#�(B
Reply to this email directly or view it on GitHub:
#25 (comment)
- Yasuhiro Matsumoto
from vimproc.vim.
なるほど。これ、@mattn さんのやりかたでは解決できないんですよ。なぜなら今回問題となっているのは process.exit(1) をするエラーケースなので単純にexitをreturnにするとステータスコードをプロセスから返せなくなります。
また、console.log()は中身はprocess.stdout.write()なので、これの書き換えは意味がありません。
https://github.com/joyent/node/blob/master/lib/console.js#L24
そしてstdout.flush()に類するものはなく、stdout.end()/destroy()は例外を投げると。これは困りましたね。
from vimproc.vim.
https://groups.google.com/d/msg/nodejs/qXkr1C2c8vs/567P_mVZacsJ
drain にひっかけると良さそう。
from vimproc.vim.
これでうまいこと動いてそげです。
https://gist.github.com/3044319
#!node
function safe_quit(code) {
if (!process.stdout.write(""))
process.stdout.on('drain', function() {
process.exit(code);
})
else
process.exit(code);
}
var outputLength = 1000;
var output = '';
for (var i = 0; i < outputLength; i++) {
output += i + ': ' + Math.random() + "\n";
}
console.log(output);
safe_quit(3);
from vimproc.vim.
ありがとうございます。修正したのでお試しいただけますか。
from vimproc.vim.
動作確認出来ました。
閉じても良いと思います。
from vimproc.vim.
JSX本体側で対処してくれたのですね。ありがとうございます。
from vimproc.vim.
Related Issues (20)
- can not build vimproc's native extensions HOT 2
- Is there any way to highlight the line or line number the error is on? HOT 1
- Support passing Environment Variables to subprocesses HOT 2
- Windows binaries out of date? HOT 3
- Appveyor build is failed HOT 1
- vimproc#system works but vimproc#system_bg doesn't on Windows 10 HOT 3
- Get the version of vimproc via vim script. HOT 4
- Checking vimproc in BSD HOT 1
- faulty cygwin detection HOT 2
- How can I apply a parameter when use vimproc? HOT 2
- try to upgrade do make[1]: Nothing to be done for `all' HOT 1
- async stdout/stdin support HOT 3
- Code signature not valid for use in process HOT 10
- [Question] How to work with an interactive process? HOT 2
- Suggestion: Add Cygwin64 environment
- Would it be possible to use vim job to replace compiled dll? HOT 2
- MacOS 10.14.6 install/build error HOT 1
- Need Help From Beginner HOT 4
- Why not implement one .bat which can build this plugin with msvc toolchain? HOT 3
- (mach-o file, but is an incompatible architecture (have 'arm64', need 'arm64e')), '/usr/lib/vimproc_mac.so' (no such file)" HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from vimproc.vim.