[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
tgoto(3) says col,row but it seems to be x,col?
From: |
Steffen Nurpmeso |
Subject: |
tgoto(3) says col,row but it seems to be x,col? |
Date: |
Sat, 19 Mar 2016 16:40:17 +0100 |
User-agent: |
s-nail v14.8.6-171-gc05ee4b |
Hello,
and termcap(5) says "ch Move cursor horizontally only to column
%1" and terminfo(5) says "column_address hpa ch horizontal
%position #1, absolute (P)", but when i'm doing
n_termcap_cmd(n_TERMCAP_CMD_ch, w, -1) which translates to
tgoto(cp, a1, a2) then nothing happens, i have to write
tgoto(cp,0,a1) instead.
I.e., the following program moves the cursor to column 42!
That's not right, is it. This is on current ArchLinux.
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <curses.h>
#include <term.h>
int main(void){
char buf[4096], *bp, *c_ch, *cp;
if(tgetent(bp = buf, getenv("TERM")) <= 0)
return 1;
if((c_ch = tgetstr("ch", NULL)) == NULL)
return 2;
if((cp = tgoto(c_ch, 5, 42)) == NULL)
return 3;
printf("\n");
tputs(cp, 1, putchar);
fflush(stdout);
sleep(5);
return 0;
}
--steffen
- tgoto(3) says col,row but it seems to be x,col?,
Steffen Nurpmeso <=