LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 12-01-2012, 06:17 AM   #1
vksingh
LQ Newbie
 
Registered: Mar 2010
Posts: 2

Rep: Reputation: 0
Issue with curses.h program


#include<curses.h>

int main()
{
initscr();
return 0;
}


I wrote the above code in test.c. I compile using
gcc test.c -lncurses

The above program compiled and ran completely but after that, my shell doesnot behave properly. Its printing the promt when i press ENTER

vivek@viveks:~/test$ vivek@viveks:~/test$ vivek@viveks:~/test$ vivek@viveks:~/test$ vivek@viveks:~/test$ vivek@viveks:~/test$ vivek@viveks:~/test$ vivek@viveks:~/test$ vivek@viveks:~/test$ vivek@viveks:~/test$ vivek@viveks:~/test$ vivek@viveks:~/test$ vivek@viveks:~/test$ vivek@viveks:~/test$ vivek@viveks:~/test$ vivek@viveks:~/test$ vivek@viveks:~/test$ vivek@viveks:~/test$ vivek@viveks:~/test$ vivek@viveks:~/test$ vivek@viveks:~/test$ vivek@viveks:~/test$ vivek@viveks:~/test$ vivek@viveks:~/test$ vivek@viveks:~/test$ vivek@viveks:~/test$ vivek@viveks:~/test$ vivek@viveks:~/test$ vivek@viveks:~/test$ vivek@viveks:~/test$

Can some one help me to understand why it is behaving like the above.

Regards,
Vivek
 
Old 12-01-2012, 06:25 AM   #2
eSelix
Senior Member
 
Registered: Oct 2009
Location: Wroclaw, Poland
Distribution: Arch, Kubuntu
Posts: 1,281

Rep: Reputation: 320Reputation: 320Reputation: 320Reputation: 320
initscr() prepare your terminal to work with curses functions, it needs to be restored to state before initialization. You need to call endwin() before exiting program.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] python and curses : unable to getch() for a curses.KEY event mangec Programming 1 11-09-2010 04:21 PM
New Software: Curses-Based Program Launcher CoderMan Linux - Software 8 07-17-2009 08:36 AM
do I need curses? jake_01 Programming 1 04-28-2005 06:24 AM
curses and some terminals dimm_coder Programming 9 05-10-2004 11:04 AM
Curses nitinkatageri Linux - General 2 08-18-2003 04:58 AM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 01:36 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration