isaacs
e4c9c9f412
readline: Remove event listeners on close
Fix #3756
13 years ago
Nathan Rajlich
8a9e8d60d2
readline: don't use Function#call()
It wasn't necessary.
13 years ago
Jonas Westerlund
2297d638c1
Forgotten commit: add arguments to handleGroup
13 years ago
Jonas Westerlund
0b0b72c2fa
Move function declaration to top-level
Gets rid of a strict mode error and a few levels of indentation.
13 years ago
Tim Macfarlane
0dba28b5c2
readline: fix for unicode prompts
prompt length is char length, not byte length
13 years ago
Andreas Madsen
1e0ce5d1bd
domain: the EventEmitter constructor is now always called in nodecore
13 years ago
Nathan Rajlich
032fc42e64
readline: don't cache the "keypress" listeners
it's not safe to since `removeAllListeners()` will detach the returned
Array from the stream instance if that's ever called by the user.
13 years ago
isaacs
54a4f99c4e
lint
13 years ago
Nathan Rajlich
3f69c71157
readline: explicitly disable and re-enable "raw mode" on Ctrl+Z
Fixes #3295 .
13 years ago
Nathan Rajlich
2b9967fbcc
readline: move the "setRawMode" logic into a private function
13 years ago
Kyle Robinson Young
da56c72f59
readline: remove unused vars in _ttyWrite
13 years ago
Kyle Robinson Young
e67a0f80e0
readline: _normalWrite() doesn't take a key modifier arg
13 years ago
Kyle Robinson Young
57148f54e1
readline: change char to ch to avoid reserved word
13 years ago
Nathan Rajlich
9c3559f0ad
readline: re-add the Interface#close() method; rename "end" to "close"
The idea here is to reduce the number of times that `setRawMode()` is called
on the `input` stream, since it is expensive, and simply pause()/resume()
should not call it.
So now `setRawMode()` only gets called at the beginning of the Interface
instance, and then when `Interface#close()` is called.
Test case included.
13 years ago
Nathan Rajlich
78eb174ea2
readline: use StringDecoder for decoding "normal" data
The fix from #3059 was not handling multi-byte utf8 data properly.
13 years ago
Nathan Friedly
e28f77cbad
readline: buffer data to only emit 'line' on '\n'
In "terminal: false" mode.
(And fire it multiple times if multiple lines arrive at once.)
This is necessary because the Windows telnet client sends every single
keystroke as it's typed.
See: http://stackoverflow.com/questions/9962197/node-js-readline-not-waiting-for-a-full-line-on-socket-connections
Closes #3059 .
13 years ago
Ben Noordhuis
b031671138
tty, readline: fix style errors
13 years ago
Nathan Rajlich
f41901cdf6
repl: make ^D emit an 'end' event on the readline instance
Also emit 'exit' on the repl when 'end' is emitted on the readline.
Fixes `node debug test/fixtures/breakpoints.js` when ^D is pressed.
13 years ago
Nathan Rajlich
aad12d0b26
readline: migrate ansi/vt100 logic from tty to readline
The overall goal here is to make readline more interoperable with other node
Streams like say a net.Socket instance, in "terminal" mode.
See #2922 for all the details.
Closes #2922 .
13 years ago
Alex Kocharin
ab518ae50e
readline: fix for terminals that insert newlines automatically
Fixes #2985 .
13 years ago
isaacs
81cd3a3cd6
lint readline.js - single-quotes preferred
13 years ago
Alex Kocharin
06a058d731
readline: row-agnostic multiline readline implementation
Fixes #2959 .
13 years ago
Nathan Rajlich
8517089b3e
Revert "readline: add multiline support"
This reverts commit 443071db57
.
Patch was overly compilicated and made some incorrect assumptions about the
position of the cursor being at the bottom of the screen. @rlidwka and I are
working on getting a proper implementation written.
13 years ago
Colton Baker
c84b3c4b73
readline: ignore stray escape sequence
Fixes #2876 .
13 years ago
Rlidwka
443071db57
readline: add multiline support
13 years ago
Colton Baker
fd61bfc731
readline: ^Z (SIGSTP) handling
Bugfix and update.
- Fixed bug where Node's REPL wouldn't continue when returning from ^Z
(SIGTSTP)
- Removed old readline callback
Readline API update with docs.
- ^Z (SIGTSTP) is now bypassed on Windows systems.
- SIGCONT is now bypassed on Windows systems.
- Docs updated to reflect above.
13 years ago
Colton Baker
ce485791db
Readline proposal and bugfixes. Related: #2737 #2756
- Removed extra newline from .question(); Users can input a
newline if it they require it.
- Removed .close() due to it only emulating closing, causing a bug where
readline is left open to trigger events such as .on('line', ...').
- Removed ._attemptClose()
- .pause() now triggers event .on('pause', ...)
- .resume() now triggers event .on('resume', ...)
- CTRL-C (SIGINT) in readline will now default to .pause() if no SIGINT event
is present.
- CTRL-D (delete right) will also default to .pause() if there is nothing to
delete (signaling the end of the file).
- Added new event `SIGTSTP`
- Added new event `SIGCONT`
- Added `resume` to `write` to resume the stream if paused.
- Docs updated.
- Updated repl.js
13 years ago
Fedor Indutny
c07edd90f5
preserve cursor pos
* configurable via .prompt()'s preserveCursor argument (false by default)
13 years ago
Ryan Dahl
2d13cdfd2a
Fixes #2052 . Readline get win cols correctly
13 years ago
Maciej Małecki
fc61134b1a
doc: fix links
Changes:
* 'http://github.com ' => 'https://github.com '
* 'https://github.com/ry/node ' => 'https://github.com/joyent/node '
* 'https://github.com/ry/http-parser ' =>
'https://github.com/joyent/http-parser '
* old issue links
* wiki link
13 years ago
Colton Baker
87286cc737
Fixed a lot of jslint errors.
Fixes #1831
13 years ago
Ryan Dahl
e1dc6e6d73
Bind uv_tty_get_winsize
13 years ago
Ben Noordhuis
92d4ed397b
readline: handle null completer graciously
Fixes #1698 .
13 years ago
Fedor Indutny
8d7aade663
[debugger] call silent resume in debugEval to prevent incorrect cursor position after repl autocompletion, small refactor in readline
13 years ago
Fedor Indutny
e13ed4a8d0
[repl, readline] refactor async completion and execution
13 years ago
Fedor Indutny
71a9aefa0f
[readline, repl] Fix completion grouping, fix parens eval results
handling
13 years ago
Fedor Indutny
42b8b77d9f
[repl, readline] async interface
Add async completion and execution interface for repl and readline
13 years ago
Robert Mustacchi
de0b8d601c
jslint cleanup: path.js, readline.js, repl.js, tls.js, tty_win32.js, url.js
14 years ago
Ryan Dahl
55048cdf79
Update copyright headers
14 years ago
Bert Belder
07f3274ac4
Readline: fixes, more key bindings
- Made backward/forward more convenient
- More key bindings that windows users are used to
- Fix delete-word-right
- Duplicate code cleanup
14 years ago
isaacs
430a7f1bed
Support pastes and meta-backspace
14 years ago
Ryan Dahl
9e976abad9
lint
14 years ago
Ryan Dahl
ba80d4d8a9
Transfer data gathering responsibility to readline
Fixes non-raw REPL/Debugger on Posix.
14 years ago
Bert Belder
e6e6e87463
Windows: fix window size getter bug
14 years ago
Bert Belder
4475b76535
Readline: use symbolic key names instead of ascii control codes
14 years ago
Bert Belder
8c9b2d1066
Readline: use tty methods instead of control sequences
14 years ago
Bert Belder
0b5bf70bff
Use tty.ReadStream and tty.WriteStream for stdio when appropriate
14 years ago
Bert Belder
dc99aa0c8c
Windows: implement missing stdio methods
14 years ago
Ryan Dahl
860e7a7a5f
debugger: don't hang on ^d and ^c
14 years ago
Ryan Dahl
b9cfd9527a
getWindowSize/setWindowSize
14 years ago