Sponsored Content
Operating Systems AIX Enabling color for putty session Post 302374428 by edgarvm on Tuesday 24th of November 2009 11:57:47 AM
Old 11-24-2009
HI phobus

well, i've started working with ncurses and the has_colors function always returns FALSE.

you're right, i can configure putty for using colors but i want to set colors for windows and more stuff

kind regards
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Enabling backspace usage in Putty SSH connection ?

I have started a new job for 2 weeks not. I am distributing software packages through Tivoli and connecting to the servers using Putty in X11 and SSH. But on the command line, the backspace is disabled. I know its a command I have to enter in my .profile but I don't remember. There is a Ctrl+H... (2 Replies)
Discussion started by: Browser_ice
2 Replies

2. Shell Programming and Scripting

Color putty

Right now I am using putty. I am using 2-3 terminals at a time. To differentiate each termianl I want to put each putty screen and background color to different colors. I tried changing the colors in normal putty but it's not working. Is there any other color putty ? Regards, Venkat (2 Replies)
Discussion started by: svenkatareddy
2 Replies

3. UNIX for Advanced & Expert Users

Putty session

Dear all, We have a practice of getting user's passwords expired after 60 days and a strong password policy. When a user tries to enter a password which is not compliant to the policy which is set putty exists without giving any feedback to the user. Below is something i captured from the... (3 Replies)
Discussion started by: earlysame55
3 Replies

4. UNIX for Dummies Questions & Answers

Putty Session Timeout

Hi, I had add the following line into .profile and .bash_profile for the timeout session to avoid putty close automatically : timeout=10800 However, i still keep encounter session time out every after 60 seconds. Can anyone please help advice. Many Thanks! (2 Replies)
Discussion started by: wancy
2 Replies

5. UNIX for Dummies Questions & Answers

connecting to an ssh session with putty/bash.

Hi, sorry if this is the wrong forum for this question but I couldnt spot another obvious forum for it. I have a windows shortcut which opens up a saved session in putty. From this session I then ssh to another remote server. I was wondering is there a way that I can either edit my shortcut... (2 Replies)
Discussion started by: newb1000
2 Replies

6. Shell Programming and Scripting

regarding Color scheme in linux console connected through putty.

Hi All, I am connecting to SunOs 5.8 server from windows machine through putty. My problem is commands are not showing any colours results. I want to see 'ls' command should list directories in 'red' and files in 'green' etc. How to do it . Please help. Also How to enable syntax colouring in... (6 Replies)
Discussion started by: Sooraj_Linux
6 Replies

7. Emergency UNIX and Linux Support

Nohup process getting killed after closing PUTTY session

I am running a process in nohup . nohup getkeys.ksh 132 > 132.out & When I close the putty terminal,The process is getting killed . default_signal_handler called for signal no: 1 Is there a way to keep the process running even If I close the terminal (2 Replies)
Discussion started by: prasperl
2 Replies

8. UNIX for Dummies Questions & Answers

Restarting a putty session

Hi, Is there any way to refresh the session(for the profile file changes get reflect) in putty? I am tired of closing reopening putty. Thanks, Pandeeesh CTRL + Q to Enable/Disable GoPhoto.it (4 Replies)
Discussion started by: pandeesh
4 Replies

9. UNIX for Dummies Questions & Answers

Putty session freezes when sudo

I have a Windows batch file with the below entry for auto login. putty.exe -ssh user1@10.10.10.7 -pw passwd1 -m command.txtcommnd.txt contains the below entries pwd sudo su - user2Switching from user1 to user2 does not require any password . Output just prints the pwd and not sudo When i... (6 Replies)
Discussion started by: mohtashims
6 Replies

10. UNIX for Beginners Questions & Answers

Text color in Linux scripts via putty

hi Folks, Can anyone help with changing the color of the words in a linux shell script? I get how to change default background etc in putty, but for some reason the text in the script has different colors for different parts of the cript. Is there a way to have one color in a linux shell... (5 Replies)
Discussion started by: jonnyd
5 Replies
can_change_color(3XCURSES)				  X/Open Curses Library Functions				can_change_color(3XCURSES)

NAME
can_change_color, color_content, COLOR_PAIR, has_colors, init_color, init_pair, pair_content, PAIR_NUMBER, start_color, COLOR_PAIRS, COLORS - manipulate color information SYNOPSIS
cc [ flag... ] file... -I /usr/xpg4/include -L /usr/xpg4/lib -R /usr/xpg4/lib -lcurses [ library... ] c89 [ flag... ] file... -lcurses [ library... ] #include <curses.h> bool can_change_color(void); int color_content(short color, short *red, short *green, short *blue); int COLOR_PAIR(int n); bool has_colors(void); int init_color(short color, short red, short green, short blue); int init_pair(short pair, short f, short b); int pair_content(short pair, short *f, short *b); int PAIR_NUMBER(int value); int start_color(voidextern int COLOR_PAIRS; extern int COLORS; DESCRIPTION
These functions manipulate color on terminals that support color. Querying Capabilities The has_colors() function indicates whether the terminal is a color terminal. The can_change_color() function indicates whether the termi- nal is a color terminal on which colors can be redefined. Initialization The start_color() function must be called to enable use of colors and before any color manipulation function is called. The function ini- tializes eight basic colors (black, red, green, yellow, blue, magenta, cyan, and white) that can be specified by the color macros (such as COLOR_BLACK) defined in <curses.h>. The initial appearance of these colors is unspecified. The function also initializes two global external variables: o COLORS defines the number of colors that the terminal supports. See Color Identification below. If COLORS is 0, the terminal does not support redefinition of colors and can_change_color() will return FALSE. o COLOR_PAIRS defines the maximum number of color-pairs that the terminal supports. See User-defined Color Pairs below. The start_color() function also restores the colors on the terminal to terminal-specific initial values. The initial background color is assumed to be black for all terminals. Color Identification The init_color() function redefines color number color, on terminals that support the redefinition of colors, to have the red, green, and blue intensity components specified by red, green, and blue, respectively. Calling init_color() also changes all occurrences of the speci- fied color on the screen to the new definition. The color_content() function identifies the intensity components of color number color. It stores the red, green, and blue intensity compo- nents of this color in the addresses pointed to by red, green, and blue, respectively. For both functions, the color argument must be in the range from 0 to and including COLORS-1. Valid intensity value range from 0 (no inten- sity component) up to and including 1000 (maximum intensity in that component). User-defined Color Pairs Calling init_pair() defines or redefines color-pair number pair to have foreground color f and background color b. Calling init_pair() changes any characters that were displayed in the color pair's old definition to the new definition and refreshes the screen. After defining the color pair, the macro COLOR_PAIR(n) returns the value of color pair n. This value is the color attribute as it would be extracted from a chtype. Controversy, the macro COLOR_NUMBER(value) returns the color pair number associated with the color attribute value. The pair_content() retrieves the component colors of a color-pair number pair. It stores the foreground and background color numbers in the variables pointed to by f and b, respectively. With init_pair() and pair_content(), the value of pair must be in a range from 0 to and including COLOR_PAIRS-1. Valid values for f and b are the range from 0 to and including COLORS-1. PARAMETERS
color Is the number of the color for which to provide information (0 to COLORS-1). red Is a pointer to the RGB value for the amount of red in color. green Is a pointer to the RGB value for the amount of green in color. blue Is a pointer to the RGB value for the amount of blue in color. n Is the number of a color pair. pair Is the number of the color pair for which to provide information (1 to COLOR_PAIRS-1). f Is a pointer to the number of the foreground color (0 to COLORS-1) in pair. b Is a pointer to the number of the background color (0 to COLORS-1) in pair. value Is a color attribute value. RETURN VALUES
The has_colors() function returns TRUE if the terminal can manipulate colors. Otherwise, it returns FALSE. The can_change_color() function returns TRUE if the terminal supports colors and is able to change their definitions. Otherwise, it returns FALSE. Upon successful completion, the other functions return OK. Otherwise, they return ERR. ERRORS
No errors are defined. USAGE
To use these functions, start_color() must be called, usually right after initscr(3XCURSES). The can_change_color() and has_colors() functions facilitate writing terminal-independent applications. For example, a programmer can use them to decide whether to use color or some other video attribute. On color terminals, a typical value of COLORS is 8 and the macros such as COLOR_BLACK return a value within the range from 0 to and includ- ing 7. However, applications cannot rely on this to be true. ATTRIBUTES
See attributes(5) for descriptions of the following attributes: +-----------------------------+-----------------------------+ | ATTRIBUTE TYPE | ATTRIBUTE VALUE | +-----------------------------+-----------------------------+ |Interface Stability |Standard | +-----------------------------+-----------------------------+ |MT-Level |Unsafe | +-----------------------------+-----------------------------+ SEE ALSO
attroff(3XCURSES), delscreen(3XCURSES), initscr(3XCURSES), libcurses(3XCURSES), attributes(5), standards(5) SunOS 5.11 5 Jun 2002 can_change_color(3XCURSES)
All times are GMT -4. The time now is 09:03 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy