AIX

AIX

Connect with fellow AIX users and experts to gain knowledge, share insights, and solve problems.

 View Only
  • 1.  changing default backgroung color

    Posted Tue April 12, 2011 06:18 AM

    Originally posted by: satyendrac


    Hello,
    We have many Production & Pre-Production AIX boxes. I wanted to set default background color of all Production boxes so any of the user who connects remotely using Putty or other SSH client to Production boxes can distinguish it clearly.
    I know I can use Putty settings to achieve this but there is no guaranty that all other users would do it.

    I tried playing around with xterm settings (setb/setf) in terminfo directory but dint had any luck.
    Can anyone please help me out on this?

    Thanks
    • Satya


  • 2.  Re: changing default backgroung color

    Posted Tue April 12, 2011 07:56 AM

    Originally posted by: shyhc


    You might try using the following thing in the users' .profile
    echo '\033[41;97m'
    Details at http://en.wikipedia.org/wiki/ANSI_escape_code

    HTH,
    Stefan


  • 3.  Re: changing default backgroung color

    Posted Tue April 12, 2011 08:26 AM

    Originally posted by: satyendrac


    I have tried this but the problem is if I re-size the Putty window from full screen (maximized) to some other size and back again to full screen, background color doesnot expand and have to issue clear command every time.

    That I guess will be irritating for all users.


  • 4.  Re: changing default backgroung color

    Posted Tue April 12, 2011 09:30 AM

    Originally posted by: shyhc


    I think the background colour should be on all places where there is output written on the terminal or where the user types something... if this isn't good enough I'll be interested in your solution
    Regards,
    Stefan


  • 5.  Re: changing default backgroung color

    Posted Tue April 12, 2011 09:57 AM

    Originally posted by: SystemAdmin


    > satyendrac wrote:
    > I have tried this but the problem is if I re-size the Putty window from full screen (maximized) to some other size and back again to full screen, background color doesnot expand and have to issue clear command every time.

    yes, that's the difference between teletype style and fullscreen style user interfaces.

    you can use different putty profiles and manage colors therein
    OR only color the prompt (PS1)
    OR use X11 xterm

    AND get back to more important tasks ;-)

    peace


  • 6.  Re: changing default backgroung color

    Posted Wed April 13, 2011 08:41 PM

    Originally posted by: SystemAdmin


    Hi,

    I am not sure which version of PuTTY you are using, but using version 0.60 and vt100 emulation, I am not having this problem. I can change screen size and the entire screen is the same background colour. You may need to examine the Putty settings and ensure that for "When window is resized:" the radiobutton "Change the number of rows and columns" is selected.

    I have a number of shell scripts which cycle continuously and which use the "termdef -c" and "termdef -l" requests to determine screen size, and then adjust the output accordingly. Most of these then use the vt100 escape sequences to change the screen colours. Nothing too fancy.


  • 7.  Re: changing default backgroung color

    Posted Wed April 13, 2011 11:20 PM

    Originally posted by: SystemAdmin


    If the Putty setting "Terminal - Use background colour to erase screen" is set, then the screen will clear to the background colour. This makes the background colour transmitted by the host fill the entire screen, and not just the echoed text.

    You may consider setting the screen background colour in /etc/profile or /etc/motd but you must then 'clear' the screen for it to work.


  • 8.  Re: changing default backgroung color

    Posted Sat December 14, 2013 09:15 AM

    Originally posted by: SURESH D


    It is possible with tput command.

    • 0: Black
    • 1: Blue
    • 2: Green
    • 3: Cyan
    • 4: Red
    • 5: Magenta
    • 6: Yellow
    • 7: White

    Try below command to change background:

    tput setb 4               -------> 4 for Red

    Try below command to change foreground:

    tput setb 4            --------> 4 for Red

    Hope this info help much...



  • 9.  Re: changing default backgroung color

    Posted Sun December 15, 2013 11:17 AM

    Originally posted by: Wouter Liefting


    I have tried this but the problem is if I re-size the Putty window from full screen (maximized) to some other size and back again to full screen, background color doesnot expand and have to issue clear command every time.

    What if you include the ANSI escape code in the PS1 prompt? At least after the user hits enter, it will be reset to the proper color. It's not perfect, but it might be good enough.