Sponsored Content
Top Forums Programming Resize current window with Curses Post 302392468 by Corona688 on Thursday 4th of February 2010 01:36:14 PM
Old 02-04-2010
I've been toying with curses a little and have found that it believes it has resized it when in fact it has not. When the program exits Putty has spammed "PuTTYPuTTYPuTTYPuTTYPuTTYPuTTY" messages to console no matter what I do, meaning curses is sending it some weird ^e control codes instead of the esc-codes one would expect of an xterm!

Looking up the actual esc codes, I made this shell function:
Code:
function resize # call resize x y
{
        echo -e "\x1b[8;${2};${1}t"
}

it acts as expected, so curses seems to be giving bananas resize codes for this for some reason.

---------- Post updated at 12:36 PM ---------- Previous update was at 12:04 PM ----------

On further testing my code was messed up. But whether the call succeeds or not, it seems that it doesn't actually send any codes to resize the window! This may be another one of those strange curses things where it's "supposed to do that" until you do the right voodoo. Or it may be a bug. With curses it's sometimes hard to tell the difference...
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

curses.h

hi i'd like to know how to draw a rectangle using the curses.h library, you know with all the WINDOW *newwin stuff and all thanx!:) (1 Reply)
Discussion started by: chomano
1 Replies

2. Windows & DOS: Issues & Discussions

window 2000 professional not pinging my window 98 system.

Hello, We someone help me resolve this problem. I have window 2000 professional, windows 98 and Unixware 7.0.1 on the network. I was able to establish connection with all. However, l was unable to ping window 98 from window 2000 professional. I was able to ping the window 2000 from the window... (10 Replies)
Discussion started by: kayode
10 Replies

3. Programming

curses & window resize issues

I am writing a program to display a database to the screen(xterm) and want to allow the window resize signal to increase/decrease the amount data that is displayed. I have a signal handler function for catching the SIGWINCH event and calling a function to reallocate the space for the windows... (0 Replies)
Discussion started by: kwaz
0 Replies

4. Solaris

CDE loging window resize?

I was asked to display a banner on the CDE login window and I have successfully accomplished that task. This is what I did: 1) made the directory /etc/dt/config/C 2) cp /usr/dt/config/C/Xresources /etc/dt/config/C 3) I edited /etc/dt/config/C/Xresources and ensured the following lines were... (0 Replies)
Discussion started by: rtoba
0 Replies

5. UNIX for Advanced & Expert Users

CDE loging window resize?

I was asked to display a banner on the CDE login window and I have successfully accomplished that task. This is what I did: 1) made the directory /etc/dt/config/C 2) cp /usr/dt/config/C/Xresources /etc/dt/config/C 3) I edited /etc/dt/config/C/Xresources and ensured the following lines were... (0 Replies)
Discussion started by: rtoba
0 Replies

6. Programming

curses.h

hi all i get a segmentation fault error in the following program. couldn't understand why it happens. can anyone explain what is really happening. s1.c #include<curses.h> main(){ int c; noecho(); cbreak(); c=getch(); printf("%c",(char)c); } I compiled this program as cc s1.c... (2 Replies)
Discussion started by: bankpro
2 Replies

7. UNIX for Advanced & Expert Users

send characters to current window

Before I re-invent the wheel... I have written an on-screen keyboard & handwriting input client in Java (spare me please, I get paid to write Java and it will take some time to get back up to speed in C & X11). In order to concentrate on the other bits, I took advantage of a hack... (0 Replies)
Discussion started by: bcw
0 Replies

8. UNIX Desktop Questions & Answers

Resize the default window size

Hi, How can I resize the terminal window's default size in CDE (Solaris)? Regards, Sharif. (1 Reply)
Discussion started by: sharif
1 Replies

9. UNIX for Dummies Questions & Answers

Preventing the terminal window to resize

I am running Terminal (xterm) on FreeBSD and XFCE. When opening a new terminal window so that an additional tab appears, the window resizes to become taller and partially hiding behind the task bar. I noticed that Xubuntu has fixed this feature and the window does not resize when opening a second... (0 Replies)
Discussion started by: figaro
0 Replies

10. UNIX for Beginners Questions & Answers

Toggle between xterm window and standard terminal window

Is it possible to toggle back and forth between an xterm invoked from one tty, and a shell invoked from a different tty? I am running Centos 7 with KDE and booting in non-graphic mode. After logging in on the default window (/dev/tty1) , I can then use ALT-F2 to access a new window (/dev/tty2),... (1 Reply)
Discussion started by: rhgscty
1 Replies
CURSES_INSERTLN(3)					   BSD Library Functions Manual 					CURSES_INSERTLN(3)

NAME
curses_insertln, insertln, winsertln -- curses insert single line routines LIBRARY
Curses Library (libcurses, -lcurses) SYNOPSIS
#include <curses.h> int insertln(void); int winsertln(WINDOW *win); DESCRIPTION
These functions insert a single line on stdscr or on the specified window. The insertln() function inserts a blank line before the current line on stdscr. The current line and all lines below are moved down one line away from the cursor and the bottom line of the window is lost. The winsertln() function is the same as the insertln() function, excepting that the line is inserted on the window win. If a scrolling region has been set with the setscrreg() or wsetscrreg() functions and the current cursor position is inside the scrolling region, then only the lines from the current line to the bottom of the scrolling region are moved down and the bottom line of the scrolling region lost. The functions insertln() and winsertln(win) are equivalent to insdelln(1) and winsdelln(win, 1), respectively. RETURN VALUES
Functions returning pointers will return NULL if an error is detected. The functions that return an int will return one of the following values: OK The function completed successfully. ERR An error occurred in the function. SEE ALSO
curses_deleteln(3), curses_insdelln(3), curses_scroll(3) STANDARDS
The NetBSD Curses library complies with the X/Open Curses specification, part of the Single Unix Specification. HISTORY
The Curses package appeared in 4.0BSD. BSD
February 5, 2006 BSD
All times are GMT -4. The time now is 01:10 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy