Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!usenet.blueworldhosting.com!feeder01.blueworldhosting.com!npeer01.iad.highwinds-media.com!news.highwinds-media.com!feed-me.highwinds-media.com!border3.nntp.dca.giganews.com!Xl.tags.giganews.com!border1.nntp.dca.giganews.com!nntp.giganews.com!local2.nntp.dca.giganews.com!nntp.westnet.com.au!news.westnet.com.au.POSTED!not-for-mail NNTP-Posting-Date: Wed, 10 Jul 2013 22:56:22 -0500 Message-ID: <51DE2CE5.3030108@smartchat.net.au> Date: Thu, 11 Jul 2013 13:56:21 +1000 From: Ron House User-Agent: Mozilla/5.0 (X11; Linux i686; rv:10.0.2) Gecko/20120216 Thunderbird/10.0.2 MIME-Version: 1.0 Newsgroups: comp.os.linux.development.apps Subject: Re: Set/get console cursor position without use ncurses References: In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Lines: 30 X-Usenet-Provider: http://www.giganews.com NNTP-Posting-Host: 124.171.213.249 X-Trace: sv3-CyA0RrsycvtWI/oYG3SrB2HSrmjcavQKvC6FhYy82fj9tTuf03lZOPuNUktHPX5liDpmJ7U/49VTDo9!rWdFkb8u0yfGmhsXEttdW57TVkcNm2v6jv0hk4IggOuZWatENYXxw3WZB8r0Mw5mewg3lmfdbW7w!kaS3 X-Complaints-To: abuse@westnet.com.au X-Abuse-and-DMCA-Info: Please be sure to forward a copy of ALL headers X-Abuse-and-DMCA-Info: Otherwise we will be unable to process your complaint properly X-Postfilter: 1.3.40 X-Original-Bytes: 2583 X-Received-Bytes: 2724 Xref: csiph.com comp.os.linux.development.apps:603 On 19/11/12 18:15, Max wrote: > Hi all > > I'm looking for a way to get and set the cursor position in a Linux > console application (pure console, not X11 console) but without use the > function move() exported by ncurses library. I want to manage the > cursor position directly from my C application without use any > additional library. Is there a way? > > Thank you for the help Having read some of the interminable discussion going on about this, and understanding the point that ncurses is actually the "correct" way to do it, if all you want to do is move the cursor, and if you are prepared to wear the fact that somewhere, someone _might_ have some whacky "terminal" that is completely nonstandard, you can't go far wrong by just looking up the ANSI terminal escape code and bunging it into your output as and when needed. Google ansi escape codes. But please don't come back saying "now what do I do to clear the rest of the line, or screen, or this weird thing is happening or my friend's toaster screen doesn't get it, or ...". If it gets complicated, to get round all your objections, get the source code of ncurses and compile it into your program. The lost space is insignificant these days. -- Ron House Building Peace: http://peacelegacy.org Australian Birds: http://wingedhearts.org Principle of Goodness academic site: http://principleofgoodness.net