- About Scala
- Documentation
- Code Examples
- Software
- Scala Developers
Re: JLine in interpreter on windows
Tue, 2009-01-27, 19:37
JLine is the one which is using native libraries, Scala is a pure-JAR distribution. As to these sorts of things working without a native library, I would like to see an example of that. JRuby, Groovy and Clojure also offer interactive shells, and each and every one of them make use of JLine. It is even possible to see native apps which exemplify improper shell management (SML-NJ).
Here's another way to think about it. Without JLine, JVM-based apps have only one technique for interacting with the command line: System.out and System.in. These are both streams, which means in the case of `in` that any data received is final. There is no "backspace" in a stream, it's just another character.
JLine circumvents this problem by abrogating the stream model for standard input and providing a richer model for interaction. Think of it like ncurses for Java.
Daniel
On Tue, Jan 27, 2009 at 12:31 PM, Naftoli Gugenheim <naftoligug@gmail.com> wrote:
Here's another way to think about it. Without JLine, JVM-based apps have only one technique for interacting with the command line: System.out and System.in. These are both streams, which means in the case of `in` that any data received is final. There is no "backspace" in a stream, it's just another character.
JLine circumvents this problem by abrogating the stream model for standard input and providing a richer model for interaction. Think of it like ncurses for Java.
Daniel
On Tue, Jan 27, 2009 at 12:31 PM, Naftoli Gugenheim <naftoligug@gmail.com> wrote:
I don't understand. If it uses native libraries then why is it restricted? And howcome without JLine these things work without a native library?
On Tue, Jan 27, 2009 at 1:22 PM, Daniel Spiewak <djspiewak@gmail.com> wrote:
This is a restriction of Java's standard input/output streams. JLine uses native libraries to access platform-specific shell behavior, allowing things like backspace, command history, home, etc. So, it's not really a bug, it's just a fact of life when working with the JVM.
Daniel
On Tue, Jan 27, 2009 at 11:58 AM, Naftoli Gugenheim <naftoligug@gmail.com> wrote:
When using the interpreter on XP without -Xnojline once you type past the end of the line you can't get the cursor back on the previous line (even with backspace). If you press Home it thinks it went to the beginning but really its on the same line. When you press End or cursor forward it prints everything it thinks you're going past so if you press Home, End it prints everything over starting from the beginning of the last line.
Also when you want to move the cursor a lot so you hold down the arrow key the cursor is invisible so you don't know when to stop.
With -Xnojline everything works normally.
Tue, 2009-01-27, 20:07
#2
Re: JLine in interpreter on windows
I stand corrected: http://sourceforge.net/tracker/index.php?func=detail&aid=1899669&group_id=64033&atid=506056
On Tue, Jan 27, 2009 at 12:58 PM, Daniel Spiewak <djspiewak@gmail.com> wrote:
On Tue, Jan 27, 2009 at 12:58 PM, Daniel Spiewak <djspiewak@gmail.com> wrote:
Ah, the key is the overflow. I've seen this problem myself both on XP and Vista. I'm assuming that the issue is with JLine itself, seeing as other programs which utilize it have the same problem. If I had to guess, I would say that it's probably something pesky in the way that cmd.exe handles multiple lines.
A quick search through the JLine bug database reveals nothing: http://sourceforge.net/tracker/?atid=506056&group_id=64033&func=browse
Daniel
On Tue, Jan 27, 2009 at 12:50 PM, Daniel Spiewak <djspiewak@gmail.com> wrote:
Oh, I read your email backwards! "When using the interpreter on XP without -Xnojline ..." I'm attempting to repeat the problem now.
Daniel
On Tue, Jan 27, 2009 at 12:43 PM, Naftoli Gugenheim <naftoligug@gmail.com> wrote:
That's why I don't understand why it works better without JLine, as I described! I guess certain things like navigating the cursor to the beginning of the line before where it wrapped are built into XP console windows and JLine circumvents that functionality and unwittingly messes it up.
scala> just try typing a really relly really long line | so that it wraps around, then try moving the curso| r back so you can fix that typo and going back to | the end of the line :)
On Tue, Jan 27, 2009 at 1:37 PM, Daniel Spiewak <djspiewak@gmail.com> wrote:
JLine is the one which is using native libraries, Scala is a pure-JAR distribution. As to these sorts of things working without a native library, I would like to see an example of that. JRuby, Groovy and Clojure also offer interactive shells, and each and every one of them make use of JLine. It is even possible to see native apps which exemplify improper shell management (SML-NJ).
Here's another way to think about it. Without JLine, JVM-based apps have only one technique for interacting with the command line: System.out and System.in. These are both streams, which means in the case of `in` that any data received is final. There is no "backspace" in a stream, it's just another character.
JLine circumvents this problem by abrogating the stream model for standard input and providing a richer model for interaction. Think of it like ncurses for Java.
Daniel
On Tue, Jan 27, 2009 at 12:31 PM, Naftoli Gugenheim <naftoligug@gmail.com> wrote:
I don't understand. If it uses native libraries then why is it restricted? And howcome without JLine these things work without a native library?
On Tue, Jan 27, 2009 at 1:22 PM, Daniel Spiewak <djspiewak@gmail.com> wrote:
This is a restriction of Java's standard input/output streams. JLine uses native libraries to access platform-specific shell behavior, allowing things like backspace, command history, home, etc. So, it's not really a bug, it's just a fact of life when working with the JVM.
Daniel
On Tue, Jan 27, 2009 at 11:58 AM, Naftoli Gugenheim <naftoligug@gmail.com> wrote:
When using the interpreter on XP without -Xnojline once you type past the end of the line you can't get the cursor back on the previous line (even with backspace). If you press Home it thinks it went to the beginning but really its on the same line. When you press End or cursor forward it prints everything it thinks you're going past so if you press Home, End it prints everything over starting from the beginning of the last line.
Also when you want to move the cursor a lot so you hold down the arrow key the cursor is invisible so you don't know when to stop.
With -Xnojline everything works normally.
Tue, 2009-01-27, 20:17
#3
Re: JLine in interpreter on windows
Oh, I read your email backwards! "When using the interpreter on XP without -Xnojline ..." I'm attempting to repeat the problem now.
Daniel
On Tue, Jan 27, 2009 at 12:43 PM, Naftoli Gugenheim <naftoligug@gmail.com> wrote:
Daniel
On Tue, Jan 27, 2009 at 12:43 PM, Naftoli Gugenheim <naftoligug@gmail.com> wrote:
That's why I don't understand why it works better without JLine, as I described! I guess certain things like navigating the cursor to the beginning of the line before where it wrapped are built into XP console windows and JLine circumvents that functionality and unwittingly messes it up.
scala> just try typing a really relly really long line | so that it wraps around, then try moving the curso| r back so you can fix that typo and going back to | the end of the line :)
On Tue, Jan 27, 2009 at 1:37 PM, Daniel Spiewak <djspiewak@gmail.com> wrote:
JLine is the one which is using native libraries, Scala is a pure-JAR distribution. As to these sorts of things working without a native library, I would like to see an example of that. JRuby, Groovy and Clojure also offer interactive shells, and each and every one of them make use of JLine. It is even possible to see native apps which exemplify improper shell management (SML-NJ).
Here's another way to think about it. Without JLine, JVM-based apps have only one technique for interacting with the command line: System.out and System.in. These are both streams, which means in the case of `in` that any data received is final. There is no "backspace" in a stream, it's just another character.
JLine circumvents this problem by abrogating the stream model for standard input and providing a richer model for interaction. Think of it like ncurses for Java.
Daniel
On Tue, Jan 27, 2009 at 12:31 PM, Naftoli Gugenheim <naftoligug@gmail.com> wrote:
I don't understand. If it uses native libraries then why is it restricted? And howcome without JLine these things work without a native library?
On Tue, Jan 27, 2009 at 1:22 PM, Daniel Spiewak <djspiewak@gmail.com> wrote:
This is a restriction of Java's standard input/output streams. JLine uses native libraries to access platform-specific shell behavior, allowing things like backspace, command history, home, etc. So, it's not really a bug, it's just a fact of life when working with the JVM.
Daniel
On Tue, Jan 27, 2009 at 11:58 AM, Naftoli Gugenheim <naftoligug@gmail.com> wrote:
When using the interpreter on XP without -Xnojline once you type past the end of the line you can't get the cursor back on the previous line (even with backspace). If you press Home it thinks it went to the beginning but really its on the same line. When you press End or cursor forward it prints everything it thinks you're going past so if you press Home, End it prints everything over starting from the beginning of the last line.
Also when you want to move the cursor a lot so you hold down the arrow key the cursor is invisible so you don't know when to stop.
With -Xnojline everything works normally.
Tue, 2009-01-27, 20:27
#4
Re: JLine in interpreter on windows
Ah, the key is the overflow. I've seen this problem myself both on XP and Vista. I'm assuming that the issue is with JLine itself, seeing as other programs which utilize it have the same problem. If I had to guess, I would say that it's probably something pesky in the way that cmd.exe handles multiple lines.
A quick search through the JLine bug database reveals nothing: http://sourceforge.net/tracker/?atid=506056&group_id=64033&func=browse
Daniel
On Tue, Jan 27, 2009 at 12:50 PM, Daniel Spiewak <djspiewak@gmail.com> wrote:
A quick search through the JLine bug database reveals nothing: http://sourceforge.net/tracker/?atid=506056&group_id=64033&func=browse
Daniel
On Tue, Jan 27, 2009 at 12:50 PM, Daniel Spiewak <djspiewak@gmail.com> wrote:
Oh, I read your email backwards! "When using the interpreter on XP without -Xnojline ..." I'm attempting to repeat the problem now.
Daniel
On Tue, Jan 27, 2009 at 12:43 PM, Naftoli Gugenheim <naftoligug@gmail.com> wrote:
That's why I don't understand why it works better without JLine, as I described! I guess certain things like navigating the cursor to the beginning of the line before where it wrapped are built into XP console windows and JLine circumvents that functionality and unwittingly messes it up.
scala> just try typing a really relly really long line | so that it wraps around, then try moving the curso| r back so you can fix that typo and going back to | the end of the line :)
On Tue, Jan 27, 2009 at 1:37 PM, Daniel Spiewak <djspiewak@gmail.com> wrote:
JLine is the one which is using native libraries, Scala is a pure-JAR distribution. As to these sorts of things working without a native library, I would like to see an example of that. JRuby, Groovy and Clojure also offer interactive shells, and each and every one of them make use of JLine. It is even possible to see native apps which exemplify improper shell management (SML-NJ).
Here's another way to think about it. Without JLine, JVM-based apps have only one technique for interacting with the command line: System.out and System.in. These are both streams, which means in the case of `in` that any data received is final. There is no "backspace" in a stream, it's just another character.
JLine circumvents this problem by abrogating the stream model for standard input and providing a richer model for interaction. Think of it like ncurses for Java.
Daniel
On Tue, Jan 27, 2009 at 12:31 PM, Naftoli Gugenheim <naftoligug@gmail.com> wrote:
I don't understand. If it uses native libraries then why is it restricted? And howcome without JLine these things work without a native library?
On Tue, Jan 27, 2009 at 1:22 PM, Daniel Spiewak <djspiewak@gmail.com> wrote:
This is a restriction of Java's standard input/output streams. JLine uses native libraries to access platform-specific shell behavior, allowing things like backspace, command history, home, etc. So, it's not really a bug, it's just a fact of life when working with the JVM.
Daniel
On Tue, Jan 27, 2009 at 11:58 AM, Naftoli Gugenheim <naftoligug@gmail.com> wrote:
When using the interpreter on XP without -Xnojline once you type past the end of the line you can't get the cursor back on the previous line (even with backspace). If you press Home it thinks it went to the beginning but really its on the same line. When you press End or cursor forward it prints everything it thinks you're going past so if you press Home, End it prints everything over starting from the beginning of the last line.
Also when you want to move the cursor a lot so you hold down the arrow key the cursor is invisible so you don't know when to stop.
With -Xnojline everything works normally.
Tue, 2009-01-27, 20:27
#5
Re: JLine in interpreter on windows
You can always edit the scala.bat file to add -Xnojline to the list of options passed to the Scala shell (down at the bottom of the file). Without JLine, command history would be cmd's if it is anything at all.
I think that UnsupportedTerminal is basically just using System.in, which means that's exactly the same as -Xnojline. In fact, that's probably what Scala does to disable JLine without massive ugliness.
Daniel
On Tue, Jan 27, 2009 at 1:06 PM, Naftoli Gugenheim <naftoligug@gmail.com> wrote:
I think that UnsupportedTerminal is basically just using System.in, which means that's exactly the same as -Xnojline. In fact, that's probably what Scala does to disable JLine without massive ugliness.
Daniel
On Tue, Jan 27, 2009 at 1:06 PM, Naftoli Gugenheim <naftoligug@gmail.com> wrote:
What do they mean that setting the terminal type to unsupported fixes the editing...? Does that require editing the source code? Thanks for looking into it. Is it possible to set the default to no JLine somehow? Also without JLine is the command history scala's or cmd's?
Thanks!
On Tue, Jan 27, 2009 at 2:00 PM, Daniel Spiewak <djspiewak@gmail.com> wrote:
I stand corrected: http://sourceforge.net/tracker/index.php?func=detail&aid=1899669&group_id=64033&atid=506056
On Tue, Jan 27, 2009 at 12:58 PM, Daniel Spiewak <djspiewak@gmail.com> wrote:
Ah, the key is the overflow. I've seen this problem myself both on XP and Vista. I'm assuming that the issue is with JLine itself, seeing as other programs which utilize it have the same problem. If I had to guess, I would say that it's probably something pesky in the way that cmd.exe handles multiple lines.
A quick search through the JLine bug database reveals nothing: http://sourceforge.net/tracker/?atid=506056&group_id=64033&func=browse
Daniel
On Tue, Jan 27, 2009 at 12:50 PM, Daniel Spiewak <djspiewak@gmail.com> wrote:
Oh, I read your email backwards! "When using the interpreter on XP without -Xnojline ..." I'm attempting to repeat the problem now.
Daniel
On Tue, Jan 27, 2009 at 12:43 PM, Naftoli Gugenheim <naftoligug@gmail.com> wrote:
That's why I don't understand why it works better without JLine, as I described! I guess certain things like navigating the cursor to the beginning of the line before where it wrapped are built into XP console windows and JLine circumvents that functionality and unwittingly messes it up.
scala> just try typing a really relly really long line | so that it wraps around, then try moving the curso| r back so you can fix that typo and going back to | the end of the line :)
On Tue, Jan 27, 2009 at 1:37 PM, Daniel Spiewak <djspiewak@gmail.com> wrote:
JLine is the one which is using native libraries, Scala is a pure-JAR distribution. As to these sorts of things working without a native library, I would like to see an example of that. JRuby, Groovy and Clojure also offer interactive shells, and each and every one of them make use of JLine. It is even possible to see native apps which exemplify improper shell management (SML-NJ).
Here's another way to think about it. Without JLine, JVM-based apps have only one technique for interacting with the command line: System.out and System.in. These are both streams, which means in the case of `in` that any data received is final. There is no "backspace" in a stream, it's just another character.
JLine circumvents this problem by abrogating the stream model for standard input and providing a richer model for interaction. Think of it like ncurses for Java.
Daniel
On Tue, Jan 27, 2009 at 12:31 PM, Naftoli Gugenheim <naftoligug@gmail.com> wrote:
I don't understand. If it uses native libraries then why is it restricted? And howcome without JLine these things work without a native library?
On Tue, Jan 27, 2009 at 1:22 PM, Daniel Spiewak <djspiewak@gmail.com> wrote:
This is a restriction of Java's standard input/output streams. JLine uses native libraries to access platform-specific shell behavior, allowing things like backspace, command history, home, etc. So, it's not really a bug, it's just a fact of life when working with the JVM.
Daniel
On Tue, Jan 27, 2009 at 11:58 AM, Naftoli Gugenheim <naftoligug@gmail.com> wrote:
When using the interpreter on XP without -Xnojline once you type past the end of the line you can't get the cursor back on the previous line (even with backspace). If you press Home it thinks it went to the beginning but really its on the same line. When you press End or cursor forward it prints everything it thinks you're going past so if you press Home, End it prints everything over starting from the beginning of the last line.
Also when you want to move the cursor a lot so you hold down the arrow key the cursor is invisible so you don't know when to stop.
With -Xnojline everything works normally.
Tue, 2009-01-27, 20:37
#6
Re: JLine in interpreter on windows
What do they mean that setting the terminal type to unsupported fixes the editing...? Does that require editing the source code?
Thanks for looking into it.
Is it possible to set the default to no JLine somehow? Also without JLine is the command history scala's or cmd's?
Thanks!
On Tue, Jan 27, 2009 at 2:00 PM, Daniel Spiewak <djspiewak@gmail.com> wrote:
Thanks!
On Tue, Jan 27, 2009 at 2:00 PM, Daniel Spiewak <djspiewak@gmail.com> wrote:
I stand corrected: http://sourceforge.net/tracker/index.php?func=detail&aid=1899669&group_id=64033&atid=506056
On Tue, Jan 27, 2009 at 12:58 PM, Daniel Spiewak <djspiewak@gmail.com> wrote:
Ah, the key is the overflow. I've seen this problem myself both on XP and Vista. I'm assuming that the issue is with JLine itself, seeing as other programs which utilize it have the same problem. If I had to guess, I would say that it's probably something pesky in the way that cmd.exe handles multiple lines.
A quick search through the JLine bug database reveals nothing: http://sourceforge.net/tracker/?atid=506056&group_id=64033&func=browse
Daniel
On Tue, Jan 27, 2009 at 12:50 PM, Daniel Spiewak <djspiewak@gmail.com> wrote:
Oh, I read your email backwards! "When using the interpreter on XP without -Xnojline ..." I'm attempting to repeat the problem now.
Daniel
On Tue, Jan 27, 2009 at 12:43 PM, Naftoli Gugenheim <naftoligug@gmail.com> wrote:
That's why I don't understand why it works better without JLine, as I described! I guess certain things like navigating the cursor to the beginning of the line before where it wrapped are built into XP console windows and JLine circumvents that functionality and unwittingly messes it up.
scala> just try typing a really relly really long line | so that it wraps around, then try moving the curso| r back so you can fix that typo and going back to | the end of the line :)
On Tue, Jan 27, 2009 at 1:37 PM, Daniel Spiewak <djspiewak@gmail.com> wrote:
JLine is the one which is using native libraries, Scala is a pure-JAR distribution. As to these sorts of things working without a native library, I would like to see an example of that. JRuby, Groovy and Clojure also offer interactive shells, and each and every one of them make use of JLine. It is even possible to see native apps which exemplify improper shell management (SML-NJ).
Here's another way to think about it. Without JLine, JVM-based apps have only one technique for interacting with the command line: System.out and System.in. These are both streams, which means in the case of `in` that any data received is final. There is no "backspace" in a stream, it's just another character.
JLine circumvents this problem by abrogating the stream model for standard input and providing a richer model for interaction. Think of it like ncurses for Java.
Daniel
On Tue, Jan 27, 2009 at 12:31 PM, Naftoli Gugenheim <naftoligug@gmail.com> wrote:
I don't understand. If it uses native libraries then why is it restricted? And howcome without JLine these things work without a native library?
On Tue, Jan 27, 2009 at 1:22 PM, Daniel Spiewak <djspiewak@gmail.com> wrote:
This is a restriction of Java's standard input/output streams. JLine uses native libraries to access platform-specific shell behavior, allowing things like backspace, command history, home, etc. So, it's not really a bug, it's just a fact of life when working with the JVM.
Daniel
On Tue, Jan 27, 2009 at 11:58 AM, Naftoli Gugenheim <naftoligug@gmail.com> wrote:
When using the interpreter on XP without -Xnojline once you type past the end of the line you can't get the cursor back on the previous line (even with backspace). If you press Home it thinks it went to the beginning but really its on the same line. When you press End or cursor forward it prints everything it thinks you're going past so if you press Home, End it prints everything over starting from the beginning of the last line.
Also when you want to move the cursor a lot so you hold down the arrow key the cursor is invisible so you don't know when to stop.
With -Xnojline everything works normally.
Tue, 2009-01-27, 20:37
#7
Re: JLine in interpreter on windows
The best environment I've used the Scala interpreter in has been M-x shell from within emacs. You get emacs' editing, and you get parenthesis matching and textual completion and you end up saying 'and' too much.
2009/1/27 Daniel Spiewak <djspiewak@gmail.com>
2009/1/27 Daniel Spiewak <djspiewak@gmail.com>
You can always edit the scala.bat file to add -Xnojline to the list of options passed to the Scala shell (down at the bottom of the file). Without JLine, command history would be cmd's if it is anything at all.
I think that UnsupportedTerminal is basically just using System.in, which means that's exactly the same as -Xnojline. In fact, that's probably what Scala does to disable JLine without massive ugliness.
Daniel
On Tue, Jan 27, 2009 at 1:06 PM, Naftoli Gugenheim <naftoligug@gmail.com> wrote:What do they mean that setting the terminal type to unsupported fixes the editing...? Does that require editing the source code? Thanks for looking into it. Is it possible to set the default to no JLine somehow? Also without JLine is the command history scala's or cmd's?
Thanks!
On Tue, Jan 27, 2009 at 2:00 PM, Daniel Spiewak <djspiewak@gmail.com> wrote:
I stand corrected: http://sourceforge.net/tracker/index.php?func=detail&aid=1899669&group_id=64033&atid=506056
On Tue, Jan 27, 2009 at 12:58 PM, Daniel Spiewak <djspiewak@gmail.com> wrote:
Ah, the key is the overflow. I've seen this problem myself both on XP and Vista. I'm assuming that the issue is with JLine itself, seeing as other programs which utilize it have the same problem. If I had to guess, I would say that it's probably something pesky in the way that cmd.exe handles multiple lines.
A quick search through the JLine bug database reveals nothing: http://sourceforge.net/tracker/?atid=506056&group_id=64033&func=browse
Daniel
On Tue, Jan 27, 2009 at 12:50 PM, Daniel Spiewak <djspiewak@gmail.com> wrote:
Oh, I read your email backwards! "When using the interpreter on XP without -Xnojline ..." I'm attempting to repeat the problem now.
Daniel
On Tue, Jan 27, 2009 at 12:43 PM, Naftoli Gugenheim <naftoligug@gmail.com> wrote:
That's why I don't understand why it works better without JLine, as I described! I guess certain things like navigating the cursor to the beginning of the line before where it wrapped are built into XP console windows and JLine circumvents that functionality and unwittingly messes it up.
scala> just try typing a really relly really long line | so that it wraps around, then try moving the curso| r back so you can fix that typo and going back to | the end of the line :)
On Tue, Jan 27, 2009 at 1:37 PM, Daniel Spiewak <djspiewak@gmail.com> wrote:
JLine is the one which is using native libraries, Scala is a pure-JAR distribution. As to these sorts of things working without a native library, I would like to see an example of that. JRuby, Groovy and Clojure also offer interactive shells, and each and every one of them make use of JLine. It is even possible to see native apps which exemplify improper shell management (SML-NJ).
Here's another way to think about it. Without JLine, JVM-based apps have only one technique for interacting with the command line: System.out and System.in. These are both streams, which means in the case of `in` that any data received is final. There is no "backspace" in a stream, it's just another character.
JLine circumvents this problem by abrogating the stream model for standard input and providing a richer model for interaction. Think of it like ncurses for Java.
Daniel
On Tue, Jan 27, 2009 at 12:31 PM, Naftoli Gugenheim <naftoligug@gmail.com> wrote:
I don't understand. If it uses native libraries then why is it restricted? And howcome without JLine these things work without a native library?
On Tue, Jan 27, 2009 at 1:22 PM, Daniel Spiewak <djspiewak@gmail.com> wrote:
This is a restriction of Java's standard input/output streams. JLine uses native libraries to access platform-specific shell behavior, allowing things like backspace, command history, home, etc. So, it's not really a bug, it's just a fact of life when working with the JVM.
Daniel
On Tue, Jan 27, 2009 at 11:58 AM, Naftoli Gugenheim <naftoligug@gmail.com> wrote:
When using the interpreter on XP without -Xnojline once you type past the end of the line you can't get the cursor back on the previous line (even with backspace). If you press Home it thinks it went to the beginning but really its on the same line. When you press End or cursor forward it prints everything it thinks you're going past so if you press Home, End it prints everything over starting from the beginning of the last line.
Also when you want to move the cursor a lot so you hold down the arrow key the cursor is invisible so you don't know when to stop.
With -Xnojline everything works normally.
Tue, 2009-01-27, 22:27
#8
Re: JLine in interpreter on windows
On Tue, Jan 27, 2009 at 2:10 PM, Daniel Spiewak <djspiewak@gmail.com> wrote:
You can always edit the scala.bat file to add -Xnojline to the list of options passed to the Scala shell (down at the bottom of the file).Good point! Thanks!
Without JLine, command history would be cmd's if it is anything at all.
I think that UnsupportedTerminal is basically just using System.in, which means that's exactly the same as -Xnojline. In fact, that's probably what Scala does to disable JLine without massive ugliness.
Daniel
On Tue, Jan 27, 2009 at 1:06 PM, Naftoli Gugenheim <naftoligug@gmail.com> wrote:
What do they mean that setting the terminal type to unsupported fixes the editing...? Does that require editing the source code? Thanks for looking into it. Is it possible to set the default to no JLine somehow? Also without JLine is the command history scala's or cmd's?
Thanks!
On Tue, Jan 27, 2009 at 2:00 PM, Daniel Spiewak <djspiewak@gmail.com> wrote:
I stand corrected: http://sourceforge.net/tracker/index.php?func=detail&aid=1899669&group_id=64033&atid=506056
On Tue, Jan 27, 2009 at 12:58 PM, Daniel Spiewak <djspiewak@gmail.com> wrote:
Ah, the key is the overflow. I've seen this problem myself both on XP and Vista. I'm assuming that the issue is with JLine itself, seeing as other programs which utilize it have the same problem. If I had to guess, I would say that it's probably something pesky in the way that cmd.exe handles multiple lines.
A quick search through the JLine bug database reveals nothing: http://sourceforge.net/tracker/?atid=506056&group_id=64033&func=browse
Daniel
On Tue, Jan 27, 2009 at 12:50 PM, Daniel Spiewak <djspiewak@gmail.com> wrote:
Oh, I read your email backwards! "When using the interpreter on XP without -Xnojline ..." I'm attempting to repeat the problem now.
Daniel
On Tue, Jan 27, 2009 at 12:43 PM, Naftoli Gugenheim <naftoligug@gmail.com> wrote:
That's why I don't understand why it works better without JLine, as I described! I guess certain things like navigating the cursor to the beginning of the line before where it wrapped are built into XP console windows and JLine circumvents that functionality and unwittingly messes it up.
scala> just try typing a really relly really long line | so that it wraps around, then try moving the curso| r back so you can fix that typo and going back to | the end of the line :)
On Tue, Jan 27, 2009 at 1:37 PM, Daniel Spiewak <djspiewak@gmail.com> wrote:
JLine is the one which is using native libraries, Scala is a pure-JAR distribution. As to these sorts of things working without a native library, I would like to see an example of that. JRuby, Groovy and Clojure also offer interactive shells, and each and every one of them make use of JLine. It is even possible to see native apps which exemplify improper shell management (SML-NJ).
Here's another way to think about it. Without JLine, JVM-based apps have only one technique for interacting with the command line: System.out and System.in. These are both streams, which means in the case of `in` that any data received is final. There is no "backspace" in a stream, it's just another character.
JLine circumvents this problem by abrogating the stream model for standard input and providing a richer model for interaction. Think of it like ncurses for Java.
Daniel
On Tue, Jan 27, 2009 at 12:31 PM, Naftoli Gugenheim <naftoligug@gmail.com> wrote:
I don't understand. If it uses native libraries then why is it restricted? And howcome without JLine these things work without a native library?
On Tue, Jan 27, 2009 at 1:22 PM, Daniel Spiewak <djspiewak@gmail.com> wrote:
This is a restriction of Java's standard input/output streams. JLine uses native libraries to access platform-specific shell behavior, allowing things like backspace, command history, home, etc. So, it's not really a bug, it's just a fact of life when working with the JVM.
Daniel
On Tue, Jan 27, 2009 at 11:58 AM, Naftoli Gugenheim <naftoligug@gmail.com> wrote:
When using the interpreter on XP without -Xnojline once you type past the end of the line you can't get the cursor back on the previous line (even with backspace). If you press Home it thinks it went to the beginning but really its on the same line. When you press End or cursor forward it prints everything it thinks you're going past so if you press Home, End it prints everything over starting from the beginning of the last line.
Also when you want to move the cursor a lot so you hold down the arrow key the cursor is invisible so you don't know when to stop.
With -Xnojline everything works normally.
scala> just try typing a really relly really long line | so that it wraps around, then try moving the curso| r back so you can fix that typo and going back to | the end of the line :)
On Tue, Jan 27, 2009 at 1:37 PM, Daniel Spiewak <djspiewak@gmail.com> wrote: