[Mono-dev] Terminal config for mono csharp shell?

Cyd Haselton chaselton at gmail.com
Sun Jun 7 04:06:15 UTC 2015


Funny you should mention python.  I've ported 3.4.2 to Android and the interpreter runs without issues; no cursor jumping and no stty sane needed after exit.

In my env TERM=linux but I have other options...if that would help.  I'll take a look at the routines you mentioned, but i'm kinda hoping to find a way to resolve this without (moe) hacking at source code.

Thanks for the pointer in the right direction.

On June 6, 2015 10:41:46 PM CDT, Robert N <sushihangover at outlook.com> wrote:
>
>stty sane make sense in terms of a TERM=linux and either a messed
>up/missing termcap and/or missing capabilities during autogen/configure
>and shell that is not quite right...
>The fact that the console.unix.c works across all the std linux flavors
>and os-x would suggest that something in your environment is different.
>Not sure what your 'droid dev environment is like, but if you can
>build/debug mono, you can look at how it is init & exiting in the
>app-domain.c/console-io.c/console-unix.c routines.
>It should 'just work', but that requires a very clean environment as
>Mono does an very generic (iffy IMHO) job of tty exiting (also
>init'ing).  If you look at the ConsoleDriver the extent of the tty
>exit/teardown is 'string' that is sent is a hardcoded DC1 signal (0x11)
>which is Ctrl-Q (XON). You can browse the native driver function in
>console-unix.c, it is running on a gc'd thread, the std c lib function
>atexit is called with the tty teardown function and it does a very
>generic teardown (flushing the pipes and setting the ECHO env to true).
>Is this right or wrong? Depends upon who you ask ;-) Programs written
>in python have this this issue all the time with using no echo tty mode
>and properly exiting, it is usually a threading issue, but hard to
>prevent. A lot of P-coders just place an os.system('stty sane') in
>their exit code, perl coders place system("stty sane");  curses users
>should always use endwin(); reset(); to clean things up, etc... 
>The fact that the console.unix.c works across all the std linux flavors
>and os-x would suggest that something in your environment is different.
>Not sure what your 'droid dev environment is like, but if you can
>build/debug mono, you can look at how it is init & exiting in the
>app-domain.c/console-io.c/console-unix.c routines.
>
>From: chaselton at gmail.com
>Date: Sat, 6 Jun 2015 19:39:16 -0500
>To: mono-devel-list at lists.ximian.com
>Subject: Re: [Mono-dev] Terminal config for mono csharp shell?
>
>Additionally, running 'stty sane' after exiting the REPL solves the
>problem.  Maybe there is a way to set the REPL to run a command on
>quitting?
>
>On June 6, 2015 8:04:47 AM CDT, Cyd Haselton <chaselton at gmail.com>
>wrote:
>Are there any special terminal and/or shell settings I should set for
>the csharp shell?
>
>
>
>csharp works okay...minus some cursor jumping...but after quitting the
>console shell behaves oddly until I exit it and re-enter.
>
>
>
>Example:
>
>/home/kbox $ csharp
>
>Mono C# Shell, type "help;" for help                                   
>             
>
>Enter statements below.
>
>csharp> DateTime.Now                                                   
>             06/06/2015 13:00:31
>
>csharp> help                                                           
>             "Static methods:
>
>  Describe (object);       - Describes the object's type
>
>  LoadPackage (package);   - Loads the given Package (like -pkg:FILE)
>
> LoadAssembly (assembly); - Loads the given assembly (like -r:ASSEMBLY)
>
>  ShowVars ();             - Shows defined local variables.
>
>  ShowUsing ();            - Show active using declarations.
>
>  Prompt                   - The prompt used by the C# shell
>
>  ContinuationPrompt       - The prompt for partial input
>
>  Time (() => { });        - Times the specified code
>
>  print (obj);             - Shorthand for Console.WriteLine
>
>quit;                    - You'll never believe it - this quits the
>repl!
>
>  help;                    - This help text
>
>TabAtStartCompletes      - Whether tab will complete even on empty
>lines
>
>"
>
>csharp> quit
>
>
>
>Environment shell after quitting:
>
>/home/kbox $ /home/kbox $ /home/kbox $ /home/kbox $ /home/kbox $
>/home/kbox $ /home/kbox $ >
>/data/data/jackpal.androidterm/kbox2/bin/bash: \: not found
>
>/home/kbox $ /home/kbox $ /home/kbox $ /home/kbox $ /home/kbox $
>/home/kbox $
>
>
>
>After exiting environment shell...you can't see the 'exit' command I
>typed:
>
>/home/kbox $ 127|u0_a186 at altev:/ $
>
>127|u0_a186 at altev:/ $
>
>127|u0_a186 at altev:/ $
>
>127|u0_a186 at altev:/ $
>
>127|u0_a186 at altev:/ $
>
>
>
>Re-entering the environment shell:
>
>127|u0_a186 at altev:/ $
>/data/data/jackpal.androidterm/kbox2/bin/kbox_shell
>
>/home/kbox $
>
>/home/kbox $
>
>/home/kbox $
>
>/home/kbox $
>
>
>-- 
>
>Sent from my Android device with K-9 Mail. Please excuse my brevity.
>_______________________________________________
>Mono-devel-list mailing list
>Mono-devel-list at lists.ximian.com
>http://lists.ximian.com/mailman/listinfo/mono-devel-list 		 	   		  

-- 
Sent from my Android device with K-9 Mail. Please excuse my brevity.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.ximian.com/pipermail/mono-devel-list/attachments/20150606/3298a7e8/attachment-0001.html>


More information about the Mono-devel-list mailing list