Re: OSX prompt limit

2015-09-09 Thread Adam D. Ruppe via Digitalmars-d-learn
On Wednesday, 9 September 2015 at 01:35:26 UTC, Joel wrote: auto line = terminal.getline("your prompt: "); Huh, that should work unless your terminal is outrageously narrow or maybe output starting on the right side of the screen already. But I can't look much further without having a

Re: OSX prompt limit

2015-09-09 Thread Adam D. Ruppe via Digitalmars-d-learn
Maybe you can try gnu readline instead: extern(C) char* readline(const(char)* prompt); pragma(lib, "readline"); pragma(lib, "curses"); void main() { auto line = readline("your line: "); import std.stdio, std.conv; writeln(to!string(line)); }

Re: OSX prompt limit

2015-09-09 Thread Joel via Digitalmars-d-learn
On Wednesday, 9 September 2015 at 17:47:44 UTC, Adam D. Ruppe wrote: Maybe you can try gnu readline instead: extern(C) char* readline(const(char)* prompt); pragma(lib, "readline"); pragma(lib, "curses"); void main() { auto line = readline("your line: "); import std.stdio,

Re: OSX prompt limit

2015-09-09 Thread Adam D. Ruppe via Digitalmars-d-learn
On Wednesday, 9 September 2015 at 21:27:05 UTC, Joel wrote: Thanks Adam. That works better than normal. Up and down don't work though. There's another function called add_history for that. Readline is a pretty popular library (also GPL though, keep that in mind if you distribute your

Re: OSX prompt limit

2015-09-08 Thread Joel via Digitalmars-d-learn
On Friday, 4 September 2015 at 03:31:40 UTC, Adam D. Ruppe wrote: On Friday, 4 September 2015 at 02:17:57 UTC, Joel wrote: In Mac OS, when typing with readln etc. I can't use the cursor keys. Works in Windows though. That's normal, line editing on Unix terminals is a kinda advanced library

Re: OSX prompt limit

2015-09-08 Thread via Digitalmars-d-learn
Or just take it from the man page: https://developer.apple.com/library/mac/documentation/Darwin/Reference/ManPages/man3/signal.3.html

Re: OSX prompt limit

2015-09-08 Thread Steven Schveighoffer via Digitalmars-d-learn
On 9/8/15 9:20 AM, Adam D. Ruppe wrote: On Tuesday, 8 September 2015 at 13:17:31 UTC, Ola Fosheim Grøstad wrote: Or just take it from the man page: https://developer.apple.com/library/mac/documentation/Darwin/Reference/ManPages/man3/signal.3.html ah excellent. My web search came up with

Re: OSX prompt limit

2015-09-08 Thread Adam D. Ruppe via Digitalmars-d-learn
On Tuesday, 8 September 2015 at 13:17:31 UTC, Ola Fosheim Grøstad wrote: Or just take it from the man page: https://developer.apple.com/library/mac/documentation/Darwin/Reference/ManPages/man3/signal.3.html ah excellent. My web search came up with

Re: OSX prompt limit

2015-09-08 Thread via Digitalmars-d-learn
On Tuesday, 8 September 2015 at 13:02:35 UTC, Adam D. Ruppe wrote: On Tuesday, 8 September 2015 at 06:24:12 UTC, Joel wrote: arsd/terminal.d(1268): Error: undefined identifier 'SIGWINCH' There's a missing value in the signal header for OSX ! Could you run this little C program for me on

Re: OSX prompt limit

2015-09-08 Thread Joel via Digitalmars-d-learn
On Tuesday, 8 September 2015 at 13:20:20 UTC, Adam D. Ruppe wrote: On Tuesday, 8 September 2015 at 13:17:31 UTC, Ola Fosheim Grøstad wrote: Or just take it from the man page: https://developer.apple.com/library/mac/documentation/Darwin/Reference/ManPages/man3/signal.3.html ah excellent. My

Re: OSX prompt limit

2015-09-08 Thread via Digitalmars-d-learn
On Wed, Sep 09, 2015 at 12:05:52AM +, Joel via Digitalmars-d-learn wrote: > Now I get the error: What is your code calling the function? The prompt might just be too long.

Re: OSX prompt limit

2015-09-08 Thread Joel via Digitalmars-d-learn
On Wednesday, 9 September 2015 at 00:44:57 UTC, via Digitalmars-d-learn wrote: On Wed, Sep 09, 2015 at 12:05:52AM +, Joel via Digitalmars-d-learn wrote: Now I get the error: What is your code calling the function? The prompt might just be too long. import terminal; void main() {

Re: OSX prompt limit

2015-09-08 Thread Adam D. Ruppe via Digitalmars-d-learn
On Tuesday, 8 September 2015 at 06:24:12 UTC, Joel wrote: arsd/terminal.d(1268): Error: undefined identifier 'SIGWINCH' There's a missing value in the signal header for OSX ! Could you run this little C program for me on your Mac and let me know the output? --- #include #include int

OSX prompt limit

2015-09-03 Thread Joel via Digitalmars-d-learn
In Mac OS, when typing with readln etc. I can't use the cursor keys. Works in Windows though.

Re: OSX prompt limit

2015-09-03 Thread Adam D. Ruppe via Digitalmars-d-learn
On Friday, 4 September 2015 at 02:17:57 UTC, Joel wrote: In Mac OS, when typing with readln etc. I can't use the cursor keys. Works in Windows though. That's normal, line editing on Unix terminals is a kinda advanced library feature. The most common lib to do it, GNU readline, is actually a