Skip to content

Make unix port use mp-readline library, take 2#1286

Closed
dpgeorge wants to merge 6 commits intomasterfrom
unix-mp-readline-v2
Closed

Make unix port use mp-readline library, take 2#1286
dpgeorge wants to merge 6 commits intomasterfrom
unix-mp-readline-v2

Conversation

@dpgeorge
Copy link
Copy Markdown
Member

An improved version of #1263, which adds mp-readline to unix port, but also keeps option to use GNU readline. Default is mp-readline.

@blmorris could you please check this on OSX?

@stinos could you please check this on Windows?

dpgeorge added 3 commits May 24, 2015 22:39
This gets uPy readline working with unix port, with tab completion and
history.  GNU readline is still supported, configure using
MICROPY_USE_READLINE variable.
@dpgeorge
Copy link
Copy Markdown
Member Author

There are still some issues with this. Eg, when executing a file it shouldn't set the terminal to raw mode.

@coveralls
Copy link
Copy Markdown

Coverage Status

Coverage remained the same at 93.82% when pulling 2949d08 on unix-mp-readline-v2 into 3c4b5d4 on master.

@Anton-2
Copy link
Copy Markdown
Contributor

Anton-2 commented May 25, 2015

Tested on OS X (v 10.10.3, command line tools v 6.3). Compiles cleanly, works perfectly.

@blmorris
Copy link
Copy Markdown
Contributor

@Anton-2 - Thanks, good to hear. I won't get a chance to try it until this evening - using 10.7.5, although it probably won't make a difference with compiling.

@blmorris
Copy link
Copy Markdown
Contributor

Working for me, compiles, tests pass, looks good.

@stinos
Copy link
Copy Markdown
Contributor

stinos commented May 27, 2015

Seems ok for msvc after implementing it's own mp_hal due to lack of termios and VT100 commands. See https://github.com/stinos/micropython/commits/unix-mp-readline-v2

@dpgeorge
Copy link
Copy Markdown
Member Author

Simplified and improved the handling of ctrl-C and setting of raw terminal mode, and merged in 9ae3fc6.

Raw mode is now only active when doing the readline call (as per GNU readline). This makes it more compatible with original behaviour (which is CPython behaviour) and decouples raw terminal mode from ctrl-C handling.

@dpgeorge dpgeorge closed this May 27, 2015
@dpgeorge dpgeorge deleted the unix-mp-readline-v2 branch May 27, 2015 15:05
@dpgeorge
Copy link
Copy Markdown
Member Author

@stinos would you be able to update your patches for msvc?

@stinos
Copy link
Copy Markdown
Contributor

stinos commented May 28, 2015

Yes no problem; also wanted to address to minor annoyances but need some info:

  • the escape sequence for the delete key I see here when using the unix port is ESC[3~ It is not handled by readline.c so I'm wondering what the reason is: do i have a different escape sequence than others, is it an oversight or is it something else?
  • it seems feasible to print a newline after using Ctrl-D as most other programs do this as well and it leaves you with a proper prompt instead of >>> <prompt here> Ok?

@pfalcon
Copy link
Copy Markdown
Contributor

pfalcon commented May 28, 2015

the delete key I see here when using the unix port is ESC[3~

Ack, that's also what I have (xterm).

@stinos stinos mentioned this pull request May 28, 2015
@dpgeorge
Copy link
Copy Markdown
Member Author

do i have a different escape sequence than others, is it an oversight or is it something else?

Reason: my keyboard doesn't have a "delete" key (only backspace) so I never use it, hence why I never implemented it :)

it seems feasible to print a newline after using Ctrl-D

Agree.

tannewt added a commit to tannewt/circuitpython that referenced this pull request Oct 23, 2018
Add support for MakerDiary nRF52840 MDK board
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants