在 Sublime Text 2 上切换节点构建窗口 [英] Toggle Node Build Window on Sublime Text 2

查看:30
本文介绍了在 Sublime Text 2 上切换节点构建窗口的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我希望能够使用一种快捷方式来运行和终止节点进程,包括根据需要显示和隐藏构建窗口.

I would like to be able to use one shortcut for running and killing node process including showing and hiding build window as needed.

我按ctrl + B:

  1. 显示构建窗口
  2. 运行节点进程

我再次按下ctrl + B:

  1. 杀死节点进程
  2. 关闭构建窗口.

我还需要发送终止信号,以便我可以在节点应用程序中读取它并在退出之前执行一些操作.

I also need kill signal to be sent so that I can read it in node application and perform couple of actions prior to the exiting.

目前我需要的第一部分正在工作,但要关闭节点应用程序,我需要 ctrl + shift + B 然后按 esc 关闭构建窗口.

Currently the first part of what I need is working but to close node app I need to ctrl + shift + B and then hit esc to close build window.

这可能吗?如果可能,怎么做?

Is this possible and if it is, how?

制作了一个与我上面描述的完全一样的 sublime text 插件.目前在 ST3(Windows 和 Linux)上测试.当前唯一的问题是,在 Windows 平台上,您的节点脚本不会为退出前程序获得正确的终止信号(SIGINT 或类似的信号).我将 sublime texts 自己的控制台用于 io 程序 - 非常方便.如果人们对它感兴趣,可能很快就会发布插件.

Made a sublime text plugin that does exactly what I described above. Currently tested on ST3 (Windows and Linux). Only issue currently is that on windows platform, your node script wont get proper kill signal (SIGINT or something similar) for pre-exit proecedures. I use sublime texts own console for io procedures - very convenient. Might release plugin soon if people feel interested in it.

推荐答案

不管怎样,我在 windows 中就那样修复它,笨蛋?谁在乎

Anyway, I fix it in windows like that, stupid? who care

{
    "shell": true,
    "windows": {
        "cmd": "(TASKKILL /F /IM node.exe || 1)&& node \"$file\""
    }
}

这篇关于在 Sublime Text 2 上切换节点构建窗口的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆