History | Log In     View a printable version of the current page.  
Issue Details (XML | Word | Printable)

Key: BOO-1002
Type: Bug Bug
Status: Resolved Resolved
Resolution: Fixed
Priority: Major Major
Assignee: Cedric Vivier
Reporter: Cedric Vivier
Votes: 0
Watchers: 1
Operations

If you were logged in you would be able to see more operations.
Boo

booish(2) instability

Created: 18/Apr/08 03:59 AM   Updated: 13/May/08 08:17 PM
Component/s: None
Affects Version/s: 0.8.1
Fix Version/s: 0.8.2

Time Tracking:
Not Specified


 Description  « Hide
There is two reproducible problems that have been reported on the mailing-list by 'Doug'.
  • a System.ArgumentOutOfRangeException is throwed when booish is run in a emacs shell.
  • entering a blank line bamboozle booish (at least on mono).

also, reported by Darius Damalakas :

  • ArgumentOutOfRangeException when number of characters > Console.BufferWidth are entered (maybe related to emacs shell error above)


 All   Comments   Work Log   Change History      Sort Order: Ascending order - Click to sort in descending order
Cedric Vivier - 13/May/08 08:53 AM
fixed in rev. 2938

Doug Morgan - 13/May/08 08:17 PM
I see some changes already made to InteractiveInterpreter2.boo. I played around in the emacs shell buffer and have some suggestions for other ways to fix emac's problems with booish. This is my first time looking at anything related to .NET, mono, or boo, so don't laugh too hard.

All my changes are relative to the InteractiveInterpreter2.boo of revision 2930 of src.

In the Console for an emacs shell buffer, at least two things seem to be quite different than a standard Console:
1) Console.BufferWidth is always 0.
2) An exception is thrown if Console.ForegroundColor is set.

So, it is easy to test for lack of capabilities and set the appropriate disabling flags to true. I added this code to Initialize() after _disableColors and _disableAutocompletion were possibly set by environment variables:
#DRM - hack for emacs shell buffer not being able to set foreground color.
if not _disableColors:
try:
Console.ForegroundColor = ConsoleColor.Black
Console.ResetColor()
except:
_disableColors = true
#DRM: Hack for emacs shell buffer.
_disableAutocompletion = true if Console.BufferWidth == 0
With this change (and the next change below) you don't have to set environment variables. It just works.

One more change fixes the autocompletion-related problems with emacs. Replace the line:
if cx < len(line): #line-editing support
with the line:
if cx < len(line) and not _disableAutocompletion: #line-editing support
This is necessary because Console.BufferWidth being 0 causes cx < len(line) to be true when you would prefer it to be false.

I also fixed the blank line problem by changing the line:
_indent--
to the line:
_indent-- if _indent > 0
You probably don't need this change as some different changes probably fixed it already. With this change, every time you enter a blank line, the previous value prints out again. You may or may not like this behavior.

Finally, I do suggest doing something about the colors. As a color challenged person, I do spend time trying to turn colors off on many applications I run, but default booish colors are worse than most.

Doug