Atom/Electron ill behaved meta-console apps...

You want to talk about Far Manager, but don't know where to turn?
Post Reply
d3x0r
Posts: 6
Joined: Fri 01 Apr, 2011 21:27

Atom/Electron ill behaved meta-console apps...

Post by d3x0r »

There's this thing called Atom which is a flexible text editor... http://atom.io

Which is based on Electron ... http://electron.atom.io/ which is harder to run standalone... but...

These applications leave the console to return in the background, but still write information to it.... after they have released the console....

So, like if I run a batch file that starts atom, the batch file returns and I can do other things (even in the command prompt, without FAR, and without using the 'start' command) It ends up writing its console output to that window (which is a bit at startup and shutdown)

if I run another batch file that has something that pauses (say I start a node server) after the fact, and I hit ctrl-C on the node process to end the batch file, atom also ends up getting this control-c....

I don't know. Maybe this class of application (which is pretty rare, I have not seen something exploit the system in that way before) could be handled to realize (application returned... because it's drawing the file browser panels) but is still in the background, and writes to stdout could maybe be caught and put into a window? They end up getting lost, because the background buffer isn't updated when FAR thinks to read it... so it can do the page-swapping that it does so wonderfully.

Have no idea how well any of the above translates into russian....

--------

Там эта вещь под названием Atom, который представляет собой гибкий текстовый редактор ... http://atom.io

Который основан на Electron ... http://electron.atom.io/ который труднее работать автономно ... но ...

Эти приложения оставить консоль, чтобы вернуться в фоновом режиме, но по-прежнему записывать информацию на него .... после того, как они выпустили консоль ....

Так, как если бы я запустить пакетный файл, который начинается атом, пакетный файл возвращается, и я могу делать другие вещи (даже в командной строке без FAR, и без использования команды 'Start') Она заканчивает писать его выход консоли что окно (который немного при запуске и остановке)

если я бегу еще один пакетный файл, который имеет то, что делает паузу (скажем, я начинаю сервера узла) после того, как факт, и я ударил Ctrl-C на процессе узла до конца пакетный файл, атом также заканчивает тем, что получил эту Control-C .. ..

Я не знаю. Может быть, этот класс приложения (который довольно редко, я не видел, что-то эксплуатировать систему в таким образом раньше) может быть обработан для реализации (приложение возвращается ... потому что он рисует панели браузера файлов), но все еще находится в фоновом режиме, и записывает в стандартный вывод может быть, возможно, поймали и посадили в окно? Они в конечном итоге получить потеряли, потому что фоновый буфер не обновляется, когда FAR думает, чтобы прочитать это ... так что он может сделать страницу с перестановкой(Консоль замены экрана),FAR делает это удивительно..
d3x0r
Posts: 6
Joined: Fri 01 Apr, 2011 21:27

Atom/Electron ill behaved meta-console apps...

Post by d3x0r »

(I can't find edit, copied a block too many times sorry)
User avatar
DrKnS
Posts: 6114
Joined: Thu 04 Aug, 2005 06:44
Location: Kyiv
Has thanked: 12 times
Been thanked: 426 times

Atom/Electron ill behaved meta-console apps...

Post by DrKnS »

It's actually a well known issue - first they decide to make a cute pure GUI app (so OS will not allocate that scary dark console for it by default), but then they realise than it would be useful to print some debug info somewhere, so they google for the answer and found AttachConsole(ATTACH_PARENT_PROCESS). One line of code + launch the app from cmd.exe and yay, it works! Another issue resolved.

However, it "works" only because cmd.exe doesn't print anything else itself to its console in the meantine.

The parent process has no means to realise that someone else is writing to the same console at the same time and everything is screwed up. It's rude. Get your own console if you need one.

In other words, no, we can't help. The only thing you can do is create a simple atom.cmd file: start atom.exe and use it to start the editor. In this case the parent process will be not the far.exe, but an already exited copy of cmd.exe and attaching will not be possible.
Post Reply

Return to “General Discussions”