[OpenIndiana-discuss] stty source code

James Carlson carlsonj at workingcode.com
Wed Sep 5 15:59:54 UTC 2012


Reginald Beardsley wrote:
> I find that I am unable to convert a newline returned by a remote host to NL-CR for display in a terminal window. 
> 
> So instead of:
> 
> ok
> ok
> ok
> 
> I get:
>  
> ok
>    ok
>       ok

It's unclear to me what problem you're trying to solve.  A "terminal
window" contains a terminal emulator that's displaying data from a
remote system.  The remote system decides what it will send, and that's
what stty affects.  Stty doesn't (normally, at least) affect what the
terminal window itself does with the data it sees.

The reason I say that is that the "ok" prompt you're showing looks like
it comes from a SPARC OBP prompt.  If it does, then what I think you'd
need is either an OBP command to change the CF/LF behavior or a
different terminal emulator or configuration.  OBP isn't UNIX and
doesn't have stty.

> I thought I'd try to find out why.  I also found I can't actually set "-onlcr" w/ stty though I can toggle "olcuc".  Some things in stty work and some don't.

I sometimes find "stty -g" helpful in figuring out what the line is
really configured to do, but I'm a little geeky that way.

What does your "stty -a" output say?  Does it say "opost" or "-opost?"
If it's the latter, then there'll be no output processing at all.

What application is using the tty in question, and does it issue any
ioctls?  If so, then all bets with stty may well be off -- applications
can (and very often do!) change anything they want.

The setting you logically want here is "opost onlcr -onlret".  I don't
think it's related to your problem, though.

> I've actually modified the forth interpreter to send NL-CR and reassembled the code, so my original problem is solved.  But it bugs me that things don't seem to work properly.  While ttys are not used much now in the wider world, they are still heavily used as the interface to microcontrollers both for interaction and for loading new firmware.  
> 
> I'm *very* resistant to having to use Linux for this and simply won't use Windows which is the predominate environment for working w/ microcontrollers.  Unfortunately there's a fair bit of open source stuff that doesn't like Solaris :-(  It was a good bit of work to get this far.
> 
> In view of the admin overhead, I'll probably defer working on ttymon & friends until I can setup a faster OI machine.  Working on OI wasn't actually in my plans at this time.

I think you may well be barking up the wrong tree.  Details on precisely
what software you're using and what you have connected to what via a
serial link would probably be helpful in getting a more useful response.

-- 
James Carlson         42.703N 71.076W         <carlsonj at workingcode.com>



More information about the OpenIndiana-discuss mailing list