atom-community / atom-community/atom-script
Uncaught TypeError: Cannot read property 'setEncoding' of undefined
- Dominant language
- JavaScript
- Stars
- 730
- Forks
- 264
- PR merge metrics
- No merged PRs in 30d
Description
[Enter steps to reproduce:]
1. Open Atom.
2. Open a file written in Scheme.
3. Hit CMD-I to run the script.
4. Error occurs.
IMPORTANT NOTE:
I've been messing with .atom/packages/script/lib/grammars/lisp.coffee to get my Scheme files to run using MIT Scheme instead of guile. As such, the relevant changes are included.
LINES 30-36
```
Scheme:
'Selection Based':
command: 'atom-scheme'
args: (context) -> ['-c', context.getCode()]
'File Based':
command: 'atom-scheme'
args: ({filepath}) -> [filepath]
```
'atom-scheme' is a script located in /usr/local/bin, and it looks like this:
```
#!/bin/bash
atom-scheme () {
scheme --quiet < "$1"
}
```
I created the script so I wouldn't have to worry about the args having a '<' in them.
However, this breaks, and I don't know why.
Below is the stack trace.
**Atom**: 1.40.1 x64
**Electron**: 3.1.10
**OS**: Mac OS X 10.14.6
**Thrown From**: [script](https://github.com/rgbkrk/atom-script) package 3.18.1
### Stack Trace
Uncaught TypeError: Cannot read property 'setEncoding' of undefined
```
At /Applications/Atom.app/Contents/Resources/app/static/:14
TypeError: Cannot read property 'setEncoding' of undefined
at BufferedProcess.bufferStream (/Applications/Atom.app/Contents/Resources/app/static/:14:1127503)
at BufferedProcess.handleEvents (/Applications/Atom.app/Contents/Resources/app/static/:14:1129015)
at BufferedProcess.start (/Applications/Atom.app/Contents/Resources/app/static/:14:1127023)
at new BufferedProcess (/Applications/Atom.app/Contents/Resources/app/static/:14:1126771)
at Runner.run (/packages/script/lib/runner.js:32:28)
at Runtime.execute (/packages/script/lib/runtime.js:78:17)
at HTMLElement.scriptRun (/packages/script/lib/script.js:98:40)
at CommandRegistry.handleCommandEvent (/Applications/Atom.app/Contents/Resources/app/static/:11:349123)
at KeymapManager.dispatchCommandEvent (/Applications/Atom.app/Contents/Resources/app/static/:11:1249835)
at KeymapManager.handleKeyboardEvent (/Applications/Atom.app/Contents/Resources/app/static/:11:1245969)
at WindowEventHandler.handleDocumentKeyEvent (/Applications/Atom.app/Contents/Resources/app/static/:11:284329)
```
### Commands
```
-0:25.9.0 tree-view:remove-project-folder (span.name.icon.icon-file-directory)
-0:24.1.0 application:add-project-folder (atom-pane.pane)
2x -0:15.8.0 script:run (div.tool-panel.tree-view)
```
### Non-Core Packages
```
activate-power-mode 2.7.0
atom-clock 0.1.17
atom-ide-ui 0.13.0
autocomplete-python 1.16.0
autocomplete-swift 1.0.3
go-plus 6.1.0
Hydrogen 2.12.0
ide-rust 0.21.0
language-asymptote 1.1.0
language-boo 0.1.0
language-julia 0.19.1
language-kotlin 0.5.0
language-lisp 0.2.0
language-markdown 0.37.0
language-pseudo 0.1.3
language-r 0.4.2
language-racket 0.4.0
language-rockstar 0.3.1
language-rust 0.4.12
language-scheme 1.4.0
language-swift 0.5.0
language-x86-64-assembly 2.2.11
python-tools 0.6.9
script 3.18.1
swift-debugger 0.1.2
teletype 0.13.4
terminal-plus 0.14.5
```
Contributor guide
Assessment
This issue has not been assessed yet.