skywind3000 / atom-shell-commands Goto Github PK
View Code? Open in Web Editor NEWExecute user defined shell commands (looking for new maintainers)
License: MIT License
Execute user defined shell commands (looking for new maintainers)
License: MIT License
Sorry if this a basic question but... I was wondering if there is a keyboard shortcut to close the atom-shell-command pane...
How do I enter a windows command and an argument with embedded spaces
e.g.
name: "grepWin"
command: 'C:/Program Files/grepWin/grepWin.exe'
arguments: [
"/searchFor: find me"
]
ouput:
["C:/Program Files/grepWin/grepWin.exe","/searchfor: find me"]
'C:\Program' is not recognized as an internal or external command,
operable program or batch file.
I tried all sorts of escaping (double, single quotes, cmd ^), but nothing worked.
Possible fix:
The last comment in nodejs/node-v0.x-archive#25895 seems to suggest it is the actual execute at fault.
Deprecated win-spawn's successor cross-spawn-asnyc spawn appears to address the problem as the above link suggested.
Hi!
This project is super nice, it's exactly what I was looking for!
I have one request: It would be nice to run experimental scripts that I didn't store as a file yet. Pipe them to gcc for example. For this I need the content of the whole file.
Right now I can do that by selecting everything and using {CurSelected} but you know :)
EDIT:
Seems like CurSelected does not work if the file doesn't have a name yet, so that will also be part of the feature request :D
{ProjectDir} expands to my home directory under linux instead of the actual project directory.
I have a large pandoc-file. I want to convert it into html by using the pandoc-command. The option to save the file before executing the command is enabled in the config.cson:
"*":
"atom-shell-commands":
commands: [
{
arguments: [
"-c markdown.css"
"-s"
"{FileName}"
"-o"
"{FileNameNoExt}.html"
]
command: "pandoc"
name: "translate pandoc to html"
options:
cwd: "{FileDir}"
keymap: "ctrl-2"
save: true
}
...
]
core:
...
editor:
...
I have to execute the pandoc-command twice or I have to save the file before launching the command. Otherwise, the command doesn't consider the last changes of my source file. It feels like the command is not waiting for the save-operation to be completed.
I'm not seeing the commands in the interface after putting the code below in my config file.
I'm seeing defaults only (Atom 1.58)
"atom-shell-commands":
commands: [
{
name: "compile"
command: "d:/dev/mingw/bin/gcc"
arguments: [
"{FileName}"
"-o"
"{FileNameNoExt}.exe"
]
options:
cwd: "{FileDir}"
keymap: "ctrl-2"
}
]
Hi! Thanks for maintaining the atom-shell-commands package!
In Atom v1.19, we will release a major change to Atom's core text buffer data structure. As part of this change, we have made TextBuffer.save
asynchronous; rather than blocking until the save is complete, it now immediately returns a Promise
that resolves when the save is complete. Because of this, a few other Atom APIs that use save
have similarly become async:
Pane.close
TextBuffer.save
TextEditor.save
Pane.saveItem
Pane.saveItemAs
Pane.saveActiveItem
Pane.saveActiveItemAs
Pane.saveItems
Workspace.saveActivePaneItem
Workspace.saveActivePaneItemAs
We think this package could be impacted by this upgrade because it calls the changed methods in the following places:
TextEditor.save
We found these calls using a regex search, so this list might be incomplete, and it might contain some false positives.
It should be pretty easy to adjust your package code and/or tests to work with the new async behavior, and to simultaneously keep it working with older versions of Atom. Here are some examples of pull requests we opened on our bundled packages to cope with the change:
Please let me know if you have any questions. I'd be happy to help!
I change something in .atom-shell-commands-console(atom-shell-commands.less), and restart Atom.
Nothing happen for me, why?
Hello
The output panel currently seems to be using a default, non-fixed-width font. For shell output, this sometimes results in incorrectly aligned results as terminals almost always use fixed-width fonts. It would be neat if there was a way to configure the font or if the output panel would default to using the Atom editor font instead.
Thanks in advance
I am running Atom 1.23.3 x64 with Nuclide 0.280.0 on Windows 10.
I am trying to use the package to run remote commands on a Linux host from Atom running on Windows. The idea is to run the commands through plink.exe which comes with PuTTY.
Unfortunately I am getting an ENOENT error from Atom Shell Commands for any command I try to run. I cannot even run a basic "dir" command:
"atom-shell-commands":
commands: [
{
name: "dir"
command: "dir"
}
]
When I run the command, I get the following output:
["dir"]
Error: spawn dir ENOENT
[Finished in 0.02 seconds, with code -4058]
Is the package still working on Windows?
Hello
Some commands generate colored terminal output, such as grunt. The character combinations that make up these colors are currently drawn into the output pane. Would it be possible to enable coloring of the output pane? This could possibly be achieved by using something like pty.js
. Another option would be to simply strip the characters.
Thanks for your work!
Hi! I'm on Windows10, using g++ and minGW.
g++ itself does not work, compiled programs only run as long as I didn't use the std library in the code.
At some point while trying with cmd and start and extra window and different things (can't reproduce it anymore), I got an alert window that libstdc++6.dll was not found.
From the normal console everything works.
I installed mingw using chocolatey and then manually added the directory containing g++.exe to my system path, did I miss anything?
If I execute echo %PATH% from within atom-shell-commands it gives me the same as the normal console does.
EDIT:
I just noticed that I have the same issue from another atom terminal emulator so it has probably nothing to do with your plugin...
But help would still be appreciated. But you can also close the issue and I ask on stackoverflow or something, but maybe others have the same problem.
EDIT2:
Ok I found that the g++ path that was in my PATH variable only contained g++ (together with several other chocolatey bins) but not libstdc++-6.dll, so now I switched that with another path where both things are in and now it works. Still curious why everything worked before from my normal terminal.
Hello
It would be neat if there was a way to set the default height of the output pane somewhere in the settings. It seems now that the actual size of the pane is remembered after you resize it, but only in the same window and session.
Thanks in advance
Disregard. It wasn't apparent that the config file must be formatted with exact indents.
i saw the describe about 哇 英语差有点难受 我可以配置编译和execute 但是在新窗口运行那一块出了点问题 就是在配置文件写好了以后 我该怎么做 是要写一个launch.cmd 文件吗 还是在cmd里直接运行那些source
Hello
I'm not sure if this is viable, but it seems that my current user's shell environment is not inherited. Some commands I was trying to run were generating suspicious errors about not being able to find files that were in a couple of PATH
folders I manually added, it then turned out that atom-shell-commands
was simply not inheriting them. It is possible to work around this problem by simply manually adding the PATH to the env
option.
The same problem applies to the HOME
environment variable, which is apparently used by ruby
and other applications when running gems.
Thanks in advance
When trying to install shell commands on my Hyper terminal it display an error:
bash: apm: command not found
what should i do
I'm using atom shell commands to run the php interpreter with x-debug. If I run the the program step by step the echo
s don't show up on the shell immediately. Instead, multiple lines are buffered and flushed only when the program terminates or a var_dump is executed.
I'm not sure if this issue depends on PHP, because on bash the echos are shown at every step.
Thanks a lot for this plug-in. It saves a lot work, avoiding the need of making new plug-ins for every external command integration.
I am trying to integrate the comand for this solution: http://stackoverflow.com/a/9395552/469294
More or less:
grep --color='auto' -P -n "[\x80-\xFF]" {FileName}
so I did try:
"atom-shell-commands":
commands: [
{
name: "grep_unicode"
command: "grep"
arguments: [
"--color='auto'"
"-P"
"-n"
"\"[\x80-\xFF]\""
"{FileName}"
]
options:
cwd: "{FileDir}"
keymap: "cmd-u"
}
]
but it doesn't work:
grep","--color='auto'","-P","-n","\"[�-ÿ]\"","myFile.java"]
Usage: grep [OPTION]... PATTERN [FILE]...
Search for PATTERN in each FILE or standard input.
.....
How am I supposed to specify the escape sequence for those unicode characters ?
In VS Code we can execute multiple commands using "&&" in arguments array the same can't be done in .atom/config.cson. Keymap is also not working.
"atom-shell-commands":
commands: [
{
name: "C++ - Single Source File"
command: "C:\Program Files\mingw-w64\x86_64-8.1.0-posix-seh-rt_v6-rev0\mingw64\bin\g++.exe"
arguments: [
"-std=c++17"
"{FileName}"
"-o"
"{FileNameNoExt}.exe"
"&&"
"{FileNameNoExt}.exe"
"<"
"inputf.in"
">"
"outputf.out"
]
options:
cwd: "{FileDir}"
keymap: "shift+ctrl+b"
}
]
This is the configuration that I wanted to work. Please indent it propperly if you wanna test it.
For my linux, I wanna run my program in a new terminal. I try to add a command like this:
gnome-terminal -x bash -c "./filename;exec bash;"
but this plugin may not support escape character, so I can't add it correctly.
what else method can I try?
my config:
{
name: "run-it"
command: "gnome-terminal"
arguments: [
"-x"
"bash"
"-c"
"./{FileNameNoExt};exec bash;"
]
options:
cwd: "{FileDir}"
keymap: "f6"
}
I try to execute a python script in a new window in Linux
I did as told in the manual
[Enter steps to reproduce:]
Atom: 1.23.3 x64
Electron: 1.6.15
OS: Debian GNU/Linux
Thrown From: atom-shell-commands package 1.5.0
Uncaught Error: spawn EACCES
At internal/child_process.js:313
Error: spawn EACCES
at exports._errnoException (util.js:1022:11)
at ChildProcess.spawn (internal/child_process.js:313:11)
at exports.spawn (child_process.js:399:9)
at execute (/packages/atom-shell-commands/lib/atom-shell-commands.js:449:14)
at /packages/atom-shell-commands/lib/atom-shell-commands.js:52:7)
at CommandRegistry.handleCommandEvent (/usr/share/atom/resources/app/src/command-registry.js:388:36)
at CommandRegistry.dispatch (/usr/share/atom/resources/app/src/command-registry.js:273:23)
at AtomEnvironment.module.exports.AtomEnvironment.dispatchApplicationMenuCommand (/usr/share/atom/resources/app/src/atom-environment.js:1393:34)
at EventEmitter.outerCallback (/usr/share/atom/resources/app/src/application-delegate.js:335:31)
at emitThree (events.js:116:13)
at EventEmitter.emit (events.js:194:7)
-8:43.7.0 core:move-right (input.hidden-input)
14x -8:43 core:backspace (input.hidden-input)
-8:25.2.0 core:save (input.hidden-input)
-8:12.4.0 atom-shell-commands:terminal_python3 (input.hidden-input)
2x -7:46 core:backspace (input.hidden-input)
2x -7:43.4.0 core:move-down (input.hidden-input)
-7:42.9.0 core:move-left (input.hidden-input)
-7:42.7.0 core:move-right (input.hidden-input)
9x -7:42.3.0 core:backspace (input.hidden-input)
-7:32.8.0 core:save (input.hidden-input)
-7:25.4.0 atom-shell-commands:terminal_python3 (input.hidden-input)
-6:52.9.0 core:copy (span.syntax--string.syntax--quoted.syntax--double.syntax--coffee)
2x -1:26.6.0 atom-shell-commands:terminal_python3 (input.hidden-input)
-0:34.3.0 core:save (input.hidden-input)
-0:29.4.0 atom-shell-commands:terminal_python3 (input.hidden-input)
atom-shell-commands 1.5.0
autocomplete-modules 1.10.0
autocomplete-python 1.10.5
busy-signal 1.4.3
file-icons 2.1.16
git-plus 7.10.0
hyperclick 0.1.5
intentions 1.1.5
linter 2.2.0
linter-flake8 2.3.0
linter-ui-default 1.6.10
minimap 4.29.7
predawn-syntax 1.0.4
python-autopep8 0.1.3
python-run-terminalnx 1.1.7
script 3.17.3
terminal-plus 0.14.5
it'd be nice to have an option to disable the output panel
Hello
I'm experiencing a weird styling issue with the tree view. I noticed it quite some time ago and went on thinking it was an Atom issue, but when debugging a performance problem (that wasn't in this package), I was manually disabling all my packages and noticed by accident that the issue disappeared as soon as I disabled this one.
With this package enabled, I can reproduce it by going into the tree view and clicking a folder that is collapsible. After the folder collapses, expand it again. All the items in the folder will now be highlighted in the same color as the folder name itself (i.e. in the active selection color) as if they were all selected. Clicking a file fixes the issue again.
Disabling this package whilst the incorrect styling is active removes the incorrect styling. Enabling it again makes the incorrect styling immediately reapply.
I'm using the One Dark UI theme.
Thanks in advance
Hey @skywind3000 I really like your work. The simplicity of this package is really nice. I was trying to redirect stout using a ">" as one of my arguments but got an error that looked like it was trying to pass the ">" to the program (in my case pylint), rather than allowing me to actually redirect stout to a text file as I was hoping.
Is there a way to do something like this that I'm not noticing? I was browsing through the pull request from @dqsully and wasn't sure if passing the whole command as a single string would help, as he suggested?
If there's a quick fix here I'm overlooking could you fill me in?
Thanks again for the package!
I got this error:
["mjml","-r","template.mjml","-o","template.html"]
Error: spawn mjml ENOENT
[Finished in 0.06 seconds, with code -4058]
My config:
"atom-shell-commands":
commands: [
{
name: "mjml"
command: "mjml"
arguments: [
"-r"
"{FileName}"
"-o"
"{FileNameNoExt}.html"
]
options:
cwd: "{FileDir}"
keymap: 'ctrl-2'
save: true
}
]
I'm not sure if i'm the only one who's having this issue. But, I have been trying hours and hours to figure this out but it just doesn't work for me. I have no idea what's wrong.
Hello
When opening the panel I get an error that atom-message-panel
is not found (on the line that require
s it). Is it possible that a dependency on it is missing? I tried adding it manually via the package.json
(atom-message-panel
version 1.2.7
), did an apm install
and the problem was solved for me.
Thanks in advance
[Enter steps to reproduce:]
Atom: 1.18.0 x64
Electron: 1.4.16
OS: "Arch Linux"
Thrown From: atom-shell-commands package 1.5.0
Uncaught TypeError: Bad argument
At internal/child_process.js:289
TypeError: Bad argument
at TypeError (native)
at ChildProcess.spawn (internal/child_process.js:289:26)
at exports.spawn (child_process.js:392:9)
at execute (/packages/atom-shell-commands/lib/atom-shell-commands.js:449:14)
at /packages/atom-shell-commands/lib/atom-shell-commands.js:52:7)
at CommandRegistry.module.exports.CommandRegistry.handleCommandEvent (/usr/lib/atom/src/command-registry.js:265:29)
at /usr/lib/atom/src/command-registry.js:3:59
at KeymapManager.module.exports.KeymapManager.dispatchCommandEvent (/usr/lib/atom/node_modules/atom-keymap/lib/keymap-manager.js:606:16)
at KeymapManager.module.exports.KeymapManager.handleKeyboardEvent (/usr/lib/atom/node_modules/atom-keymap/lib/keymap-manager.js:397:22)
at WindowEventHandler.module.exports.WindowEventHandler.handleDocumentKeyEvent (/usr/lib/atom/src/window-event-handler.js:100:36)
at HTMLDocument.<anonymous> (/usr/lib/atom/src/window-event-handler.js:3:59)
-0:58 core:save (input.hidden-input)
-0:57.2.0 intentions:highlight (input.hidden-input)
-0:56.9.0 pane:show-previous-item (input.hidden-input)
7x -0:55.9.0 atom-shell-commands:run (input.hidden-input)
-0:43.4.0 core:backspace (input.hidden-input)
-0:43 core:move-right (input.hidden-input)
-0:42.6.0 docblockr:parse-enter (input.hidden-input)
-0:42.6.0 editor:newline (input.hidden-input)
-0:39.8.0 autocomplete-plus:confirm (input.hidden-input)
-0:36.7.0 docblockr:parse-enter (input.hidden-input)
-0:36.7.0 editor:newline (input.hidden-input)
2x -0:31.2.0 core:move-down (input.hidden-input)
-0:30.8.0 autocomplete-plus:confirm (input.hidden-input)
-0:30.4.0 intentions:highlight (input.hidden-input)
-0:30.2.0 core:save (input.hidden-input)
2x -0:25.3.0 atom-shell-commands:run (input.hidden-input)
atom-beautify 0.30.4
atom-clock 0.1.13
atom-jinja2 0.6.0
atom-material-syntax 1.0.6
atom-material-syntax-dark 1.0.0
atom-material-syntax-light 0.4.6
atom-material-ui 2.0.4
atom-shell-commands 1.5.0
docblockr 0.11.0
dracula-syntax 2.0.5
file-icons 2.1.9
intentions 1.1.2
language-restructuredtext 1.1.0
language-vue 0.23.0
language-vue-component 0.5.0
linter-pycodestyle 2.0.2
linter-python-pep8 0.2.0
minimap 4.29.0
pigments 0.39.1
python-tools 0.6.9
rst-preview 1.3.1
tornado-templates 0.2.0
I am using Atom 1.19.2 in MacOS Sierra. When I try to save the config.cson file with additional
commands it only saves the last command.
Example:
"*":
"advanced-open-file":
createDirectories: true
createFileInstantly: true
fuzzyMatch: true
"atom-shell-commands":
commands: [
{
name: "run_script"
command: "bash"
arguments: [
"run_script.sh"
"{FileName}"
]
options:
cwd: "{FileDir}"
keymap: "ctrl-5"
}
]
# Another example
commands: [
{
name: "copy"
command: "cp"
arguments: [
"{FileName}"
"/Users/poudel/Dropbox/FileBackups/macpro_{FileNameNoExt}{FileExt}"
]
options:
cwd: "{FileDir}"
keymap: "ctrl-2"
}
]
# Another Example
commands: [
{
name: "man"
command: "/usr/bin/man"
arguments: [
"{CurWord}"
]
options:
cwd: "{FileDir}"
keymap: "ctrl-1"
}
]
Gives only the last command for man
.
I have also posted a StackOverflow question for this, but could not get the answer.
The quesition
How can we fix the problem. Help will be greatly appreciated.
atom-shell-commands is indeed one of the best packages, and I am waiting to use it.
For my personal sake, I am too busy to contribute in the future for a while,
and this repository is looking for new maintainers now.
Any one who would like to take over this plugin and make improvements for it
can feed me back.
It's my first time trying to configure something like this, so maybe I'm missing something obvious.
I have a 100% fresh install of Atom on a 100% fresh install of Ubuntu, latest version of both. I then installed the atom-shell-commands package; the first package I installed on this Atom installation.
The instructions say "File->Open Your Config" but there is no such option on the File menu of Atom.
The instructions say to edit ~/.atom/config.cson, but when I edit that file and save it, it just reverts instantly to its previous condition (which contains "atom-shell-commands": {}) so my newly added commands are lost.
There's an "Array of Commands" entry box under "Settings" in the tab, but whatever I enter there just disappears.
What are the actual steps necessary to configure atom-shell-commands?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.