0
0
mirror of https://github.com/nodejs/node.git synced 2024-11-30 07:27:22 +01:00
Commit Graph

189 Commits

Author SHA1 Message Date
isaacs
424cd5a020 Merge remote-tracking branch 'ry/v0.8' into v0.8-merge
Conflicts:
	src/node_version.h
2012-07-11 17:38:11 -07:00
Nathan Rajlich
8a9e8d60d2 readline: don't use Function#call()
It wasn't necessary.
2012-07-06 19:41:01 -07:00
Jonas Westerlund
2297d638c1 Forgotten commit: add arguments to handleGroup 2012-07-06 19:28:35 -07:00
Jonas Westerlund
0b0b72c2fa Move function declaration to top-level
Gets rid of a strict mode error and a few levels of indentation.
2012-07-06 19:28:35 -07:00
Tim Macfarlane
0dba28b5c2 readline: fix for unicode prompts
prompt length is char length, not byte length
2012-07-06 02:14:47 +02:00
Vladimir Beloborodov
3ea0397a1a readline: Use one history item for reentered line
If the command entered is exactly the same as the last history item,
don't dupe it in the history
2012-07-05 01:40:43 +02:00
Andreas Madsen
1e0ce5d1bd domain: the EventEmitter constructor is now always called in nodecore 2012-06-15 09:49:05 -07:00
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.
2012-06-14 17:26:50 -07:00
isaacs
54a4f99c4e lint 2012-06-11 08:13:36 -07:00
Nathan Rajlich
3f69c71157 readline: explicitly disable and re-enable "raw mode" on Ctrl+Z
Fixes #3295.
2012-05-21 21:09:46 -03:00
Nathan Rajlich
2b9967fbcc readline: move the "setRawMode" logic into a private function 2012-05-21 21:09:46 -03:00
Kyle Robinson Young
da56c72f59 readline: remove unused vars in _ttyWrite 2012-04-21 05:30:24 +02:00
Kyle Robinson Young
e67a0f80e0 readline: _normalWrite() doesn't take a key modifier arg 2012-04-18 23:36:46 +02:00
Kyle Robinson Young
57148f54e1 readline: change char to ch to avoid reserved word 2012-04-18 21:57:39 +02:00
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.
2012-04-17 11:53:50 -07:00
Nathan Rajlich
78eb174ea2 readline: use StringDecoder for decoding "normal" data
The fix from #3059 was not handling multi-byte utf8 data properly.
2012-04-06 16:13:40 -07:00
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.
2012-04-06 16:13:40 -07:00
Ben Noordhuis
b031671138 tty, readline: fix style errors 2012-03-29 01:36:46 +02:00
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.
2012-03-27 13:54:49 -07:00
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.
2012-03-26 15:21:25 -07:00
Alex Kocharin
ab518ae50e readline: fix for terminals that insert newlines automatically
Fixes #2985.
2012-03-26 09:21:55 -07:00
isaacs
81cd3a3cd6 lint readline.js - single-quotes preferred 2012-03-20 19:42:34 -07:00
Alex Kocharin
06a058d731 readline: row-agnostic multiline readline implementation
Fixes #2959.
2012-03-20 15:37:06 -07:00
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.
2012-03-20 15:37:06 -07:00
Colton Baker
c84b3c4b73 readline: ignore stray escape sequence
Fixes #2876.
2012-03-07 15:05:34 +01:00
Rlidwka
443071db57 readline: add multiline support 2012-03-06 13:37:42 +01:00
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.
2012-02-22 16:07:23 -08:00
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
2012-02-16 12:12:03 +06:00
Fedor Indutny
c07edd90f5 preserve cursor pos
* configurable via .prompt()'s preserveCursor argument (false by default)
2011-12-19 11:09:16 -08:00
Ryan Dahl
2d13cdfd2a Fixes #2052. Readline get win cols correctly 2011-11-08 13:37:08 -08:00
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
2011-11-01 22:26:52 +01:00
Colton Baker
87286cc737 Fixed a lot of jslint errors.
Fixes #1831
2011-10-05 18:51:06 -07:00
Ryan Dahl
e1dc6e6d73 Bind uv_tty_get_winsize 2011-09-27 13:03:28 -07:00
Ben Noordhuis
92d4ed397b readline: handle null completer graciously
Fixes #1698.
2011-09-14 17:33:07 +02:00
Fedor Indutny
8d7aade663 [debugger] call silent resume in debugEval to prevent incorrect cursor position after repl autocompletion, small refactor in readline 2011-09-09 03:05:21 +07:00
Fedor Indutny
e13ed4a8d0 [repl, readline] refactor async completion and execution 2011-09-09 02:06:07 +07:00
Fedor Indutny
71a9aefa0f [readline, repl] Fix completion grouping, fix parens eval results
handling
2011-09-09 02:06:06 +07:00
Fedor Indutny
42b8b77d9f [repl, readline] async interface
Add async completion and execution interface for repl and readline
2011-09-09 02:06:06 +07:00
Robert Mustacchi
de0b8d601c jslint cleanup: path.js, readline.js, repl.js, tls.js, tty_win32.js, url.js 2011-07-29 11:58:02 -07:00
Ryan Dahl
55048cdf79 Update copyright headers 2011-03-14 17:37:05 -07:00
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
2011-01-24 20:43:50 -08:00
isaacs
430a7f1bed Support pastes and meta-backspace 2011-01-24 20:42:52 -08:00
Ryan Dahl
9e976abad9 lint 2011-01-24 10:55:30 -08:00
Ryan Dahl
ba80d4d8a9 Transfer data gathering responsibility to readline
Fixes non-raw REPL/Debugger on Posix.
2011-01-19 11:46:16 -08:00
Bert Belder
e6e6e87463 Windows: fix window size getter bug 2011-01-18 23:22:38 -08:00
Bert Belder
4475b76535 Readline: use symbolic key names instead of ascii control codes 2011-01-18 23:22:38 -08:00
Bert Belder
8c9b2d1066 Readline: use tty methods instead of control sequences 2011-01-18 23:22:38 -08:00
Bert Belder
0b5bf70bff Use tty.ReadStream and tty.WriteStream for stdio when appropriate 2011-01-18 23:22:38 -08:00
Bert Belder
dc99aa0c8c Windows: implement missing stdio methods 2011-01-18 04:49:54 +01:00
Ryan Dahl
860e7a7a5f debugger: don't hang on ^d and ^c 2011-01-13 16:04:33 -08:00
Ryan Dahl
b9cfd9527a getWindowSize/setWindowSize 2011-01-10 17:25:48 -08:00
Ryan Dahl
5a05992155 Lint 2011-01-06 16:06:27 -08:00
Ryan Dahl
af6662d5e5 debugger: Prompt before quitting 2010-12-30 18:50:07 -08:00
Ryan Dahl
62e0ca05a6 debugger: Disable/Enable raw mode for child 2010-12-30 15:46:47 -08:00
Ryan Dahl
8874c51d04 Disable OPOST
Helps when sharing a tty with non-raw mode processes
2010-12-30 01:35:12 -08:00
Ryan Dahl
0dcbe3f74a Fork out to debugger on debugger statements
Also implement continue in Client.
2010-12-30 01:35:12 -08:00
Ryan Dahl
e3ce73a214 Add ability to ask question from readline 2010-12-30 01:35:01 -08:00
Ryan Dahl
a0e9a510b0 Introduce require('tty')
You may need to reconfigure after this commit due to the new library.
2010-12-02 18:06:43 -08:00
Ryan Dahl
e232f6e735 more lint 2010-12-01 20:28:28 -08:00
isaacs
a52f59b437 Use a proper tty test. 2010-11-27 11:36:34 -08:00
Ryan Dahl
d4af8a6b6a Add writeFilter when in the readline
Switch \n with \r\n for all strings printed out.
Necessary for writev patch.
2010-11-11 22:37:17 -08:00
Micheil Smith
e38eb0c5a4 Soft migration of sys -> util, Removal of deprecated utils module. 2010-10-11 15:21:36 -07:00
Joshaven Potter
3d4e4d8909 syntax fixes to pass jslint 2010-10-06 20:40:57 -07:00
Ryan Dahl
069d973d74 Remove require('buffer') in built-in libraries. 2010-09-28 02:31:31 -07:00
Aaron Heckmann
7c5cc57ece quicker loops 2010-09-28 01:14:58 -07:00
Ryan Dahl
d2de8ba400 ^c to get out of '...' in REPL 2010-09-16 21:07:22 -07:00
Ryan Dahl
2d09ef8541 Fix style in readline 2010-09-12 21:47:56 -07:00
Ryan Dahl
0ef8a86af2 Add SIGWINCH handler for readline 2010-09-12 21:23:53 -07:00
Trent Mick
1d961a6630 add ANSI coloring option to sys.inspect and, by default, to the repl 2010-09-08 09:47:13 -07:00
Trent Mick
5330fea954 Ctrl+W support for the REPL
FWIW, command-line style (delete back to whitespace) would be:
    leading = leading.replace(/\S+\s*$/, '');
2010-09-08 09:45:57 -07:00
Johan Euphrosine
e49be4768b add readline support for meta-d 2010-08-30 10:26:51 -07:00
Brian
d9eb64928e Fix home/end keys in repl for putty/xterm. 2010-08-23 09:18:36 -07:00
Johan Euphrosine
748469c71c add readline support for meta-f and meta-b 2010-08-23 01:47:41 -07:00
Johan Euphrosine
fd3e84499e add home/end support in rxvt and readline tests 2010-08-23 01:46:14 -07:00
Johan Euphrosine
0e1e00e68b fix home/end on GNU/Linux 2010-08-22 12:34:58 -07:00
Trent Mick
1aeaf8d289 repl tab completion: insert common prefix of multiple completions 2010-08-18 23:02:30 -07:00
Trent Mick
72e4a49cac repl completion: multi-column display of completions 2010-08-12 00:07:26 -07:00
Trent Mick
1c9a85b9a6 First pass at tab-completion in the REPL 2010-08-11 13:42:45 -07:00
Ryan Dahl
7068912fbb Export Interface from readline.js 2010-08-08 11:52:31 -07:00
Chandra Sekar S
66deea10c7 Support for HOME and END in REPL. 2010-07-26 10:59:34 -07:00
Ryan Dahl
65f2e72d77 Fix style in readline 2010-07-19 10:16:20 -07:00
Jérémy Lal
0fd1656d63 Support DEL in the REPL. 2010-07-18 22:20:23 -07:00
Blake Mizerany
8c8534046c fix whitespace errors 2010-06-29 23:59:24 -07:00
Ryan Dahl
bca16a0581 Handle ctrl+z from readline 2010-06-08 17:49:22 -07:00
Ryan Dahl
adc06dd705 Add NODE_NO_READLINE check for REPL
Setting this environmental variable to a non-zero integer will start all
REPL interfaces without readline. For use with rlwrap.
2010-06-08 15:44:43 -07:00
Ryan Dahl
0377b12964 Use strings instead of buffers in readline
For eventual large character support.
2010-06-08 10:00:43 -07:00
Matt Ranney
09af242c89 Support more readline navigation keys. 2010-06-07 16:51:07 -07:00
Ryan Dahl
e43d6fc879 Fix misspelling 2010-06-07 16:03:57 -07:00
Ryan Dahl
41f213be18 Add binding to termios, implement readline for repl 2010-06-07 15:24:21 -07:00