jms@tardis.tymnet.com (Joe Smith) (04/24/91)
In article <1991Apr18.205638.1769@wrkgrp.COM> jmd@wrkgrp.COM (Joseph M DeAngelo) writes: >I had asked an earlier question about why I was getting repeated >SIGWINCH signals while running a curses application in a Sunview >cmdtool window. I noticed that the problem disappears if I >first disable scrolling. Is there any way to disable scrolling >( that is, make the scroll bar disappear) from a C program?? The answer to your question is "output the appropriate escape sequence". Here are the relevant lines from my .cshrc file: alias header 'echo' # this is redefined in .suncmd alias cd 'cd \!*; header ${HOST}:${cwd}; set cwdh=$cwd:h; set prompt="($cwdh:t/$cwd:t) $userprompt"' # windows do not execute .login, so must do some of it here if ($?WINDOW_PARENT) then source ~/.suncmd # define header, scroll{off,on} using escape sequences # I like non-scrolling cmdtool windows; they have a nicer left margin. if ($term == sun-cmd && `tty` != /dev/ttyp0) then scrolloff; tset sun # ttyp0 is the console window endif cd $cwd # This sets the new prompt endif Here is the .suncmd file: (Note: \E signifies the ESCape character) # These definitions are here in .suncmd so that "cat .cshrc" and "cat .login" # won't cause the terminal to get confused by the escape sequences. alias scrollon 'echo -n "\E[>4h"' # enables scroll bar on cmdtool window alias scrolloff 'echo -n "\E[>4l"' # disables scroll bar if (`tty` == /dev/ttyp0 && $?WINDOW_PARENT) then alias header 'echo' # kludge for my console window else alias header 'echo -n "\E]l\!*\E\"' # change title bar endif alias iconheader 'echo -n "\E]L\!*\E\"' # change icon label In summary: To make a cmdtool window act like a shelltool window, output the sequence "escape open-square-bracket greater-than four lowercase-H". To re-enable scrolling, use "lowercase-L" instead. For more info, see the man pages on "shelltool". Joe Smith (408)922-6220 | SMTP: jms@tardis.tymnet.com or jms@gemini.tymnet.com BT Tymnet Tech Services | UUCP: ...!{ames,pyramid}!oliveb!tymix!tardis!jms PO Box 49019, MS-C51 | BIX: smithjoe | CA license plate: "POPJ P," (PDP-10) San Jose, CA 95161-9019 | humorous dislaimer: "My Amiga 3000 speaks for me."