[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [MiNT] Conholio 0.7r
Hi,
On Sunday 18 July 2010, Peter Persson wrote:
> 18 jul 2010 kl. 12.48 skrev Eero Tamminen:
> > Shouldn't it work so that user sets the terminal type in Conholio and
> > Conholio then set the TERM environment variable for the program(s) it
> > launches?
>
> Conholio is a VT100 terminal with extensions from the Linux console &
> xterm. It can also work in VT52 mode, but I've tested that part of the
> implementation for like 5 seconds :-)
>
> The TERM variable is set to 'linux' when opening a new terminal. Should
> it be configurable, or how do you mean? I'm a bit lost here.
Sorry, I misunderstood that Conholio had an option for supporting either of
them, not having features from both at the same time (Haven't yet had
time to try this great SW myself :-)). Please ignore the question.
Btw. Do you set also COLUMNS and LINES environment variables?
And send SIGWINCH to the whole process group when user changes the Conholio
window size? Note: remember to set your own process group (setsid()) when
starting so that your parent (and other) processes won't get the signals you
send to your process group.
And do you unset (or overwrite) TERMCAP in case somebody runs Conholio from
another terminal (means TERMCAP can differ from TERM value set by Conholio)?
(These questions came from looking at the wterm code. :))
> > Btw. Why Conholio in the first place supports multiple terminal types?
> > All programs use nowadays ncurses or something similar and will
> > therefore support anything described in the system terminfo database
> > (vt102, linux etc).
>
> It doesn't - it's a VT100 terminal with extensions from Linux & xterm -
> set the TERM variable to something other than 'linux' and it won't work
> as intended.
Sorry, I had mistakenly though that "linux" and "xterm" would be mostly
compatible and supersets of vt10x. After checking my own terminal
descriptions (on my Debian/stable Linux), I noticed they aren't...
Attached are listed the common parts of "linux" and "xterm" terminal
descriptions and the differences, as reported by the "infocmp" command:
infocmp -cL linux xterm
infocmp -dL linux xterm|grep -v -e ":F" -e "F:" -e -1 -e NULL
(The grep is to remove boolean, integer and strings settings that are
missing (just) from one the terminal descriptions.)
When looking at the lists, these function keys have common settings:
key_f10= '\E[21~'.
key_f11= '\E[23~'.
key_f12= '\E[24~'.
key_f6= '\E[17~'.
key_f7= '\E[18~'.
key_f8= '\E[19~'.
key_f9= '\E[20~'.
But these don't:
key_f1: '\E[[A', '\EOP'.
key_f2: '\E[[B', '\EOQ'.
key_f3: '\E[[C', '\EOR'.
key_f4: '\E[[D', '\EOS'.
key_f5: '\E[[E', '\E[15~'.
And other keys have some differences too. It's possible that these
keys are OS specific and you need to check them from different machines...
(At least in 90's there were differences between SunOS, MiNT and Linux keys
according to wterm termcap entry.)
> But to be honest - my knowledge about terminfo & termcap stuff is limited
> to... not knowing much about it.
Unfortunately I've also forgotten almost all of it. :-)
> > I've forgotten all the details, but based on the comments in the
> > terminfo entry I had written for Wterm, at least following things can
> > be specified in the given terminfo entry (i.e. can be specific to given
> > terminal type): cursor keys, home, end, pgup, pgdn, function keys
> > f1-f10, insert, delete, backspace, bell, CR, tab...
>
> Ah ok. This stuff is hard coded at the moment, but if I could read it
> from terminfo instead that would ofcourse be neat.
I'm not sure whether ncurses has an API for this, but at least you can
decompile the terminfo entries and check the values with:
infocmp -1L <terminal name>
("-1": each entry on its own line, "-L": use long C variable names)
- Eero
comparing linux to xterm.
comparing booleans.
auto_left_margin= F.
auto_right_margin= T.
back_color_erase= T.
backspaces_with_bs= F.
ceol_standout_glitch= F.
col_addr_glitch= F.
cpi_changes_res= F.
cr_cancels_micro_mode= F.
crt_no_scrolling= F.
dest_tabs_magic_smso= F.
eat_newline_glitch= T.
generic_type= F.
gnu_has_meta_key= F.
hard_copy= F.
hard_cursor= F.
has_hardware_tabs= F.
has_print_wheel= F.
has_status_line= F.
hue_lightness_saturation= F.
insert_null_glitch= F.
linefeed_is_newline= F.
lpi_changes_res= F.
memory_above= F.
memory_below= F.
move_insert_mode= T.
move_standout_mode= T.
needs_xon_xoff= F.
no_correctly_working_cr= F.
no_esc_ctlc= F.
non_dest_scroll_region= F.
non_rev_rmcup= F.
over_strike= F.
return_does_clr_eol= F.
row_addr_glitch= F.
semi_auto_right_margin= F.
status_line_esc_ok= F.
tilde_glitch= F.
transparent_underline= F.
comparing numbers.
init_tabs= 8.
max_colors= 8.
max_pairs= 64.
comparing strings.
bell= '^G'.
carriage_return= '^M'.
change_scroll_region= '\E[%i%p1%d;%p2%dr'.
clear_all_tabs= '\E[3g'.
clr_bol= '\E[1K'.
clr_eol= '\E[K'.
clr_eos= '\E[J'.
column_address= '\E[%i%p1%dG'.
cursor_address= '\E[%i%p1%d;%p2%dH'.
cursor_down= '^J'.
cursor_home= '\E[H'.
cursor_left= '^H'.
cursor_right= '\E[C'.
cursor_up= '\E[A'.
delete_character= '\E[P'.
delete_line= '\E[M'.
enter_am_mode= '\E[?7h'.
enter_blink_mode= '\E[5m'.
enter_bold_mode= '\E[1m'.
enter_insert_mode= '\E[4h'.
enter_reverse_mode= '\E[7m'.
enter_standout_mode= '\E[7m'.
enter_underline_mode= '\E[4m'.
erase_chars= '\E[%p1%dX'.
exit_am_mode= '\E[?7l'.
exit_insert_mode= '\E[4l'.
exit_standout_mode= '\E[27m'.
exit_underline_mode= '\E[24m'.
insert_line= '\E[L'.
key_backspace= '\177'.
key_btab= '\E[Z'.
key_dc= '\E[3~'.
key_f10= '\E[21~'.
key_f11= '\E[23~'.
key_f12= '\E[24~'.
key_f6= '\E[17~'.
key_f7= '\E[18~'.
key_f8= '\E[19~'.
key_f9= '\E[20~'.
key_ic= '\E[2~'.
key_mouse= '\E[M'.
key_npage= '\E[6~'.
key_ppage= '\E[5~'.
orig_pair= '\E[39;49m'.
parm_dch= '\E[%p1%dP'.
parm_delete_line= '\E[%p1%dM'.
parm_ich= '\E[%p1%d@'.
parm_insert_line= '\E[%p1%dL'.
restore_cursor= '\E8'.
row_address= '\E[%i%p1%dd'.
save_cursor= '\E7'.
scroll_forward= '^J'.
scroll_reverse= '\EM'.
set_a_background= '\E[4%p1%dm'.
set_a_foreground= '\E[3%p1%dm'.
set_tab= '\EH'.
tab= '^I'.
user6= '\E[%i%d;%dR'.
user7= '\E[6n'.
user9= '\E[c'.
comparing linux to xterm.
comparing booleans.
comparing numbers.
comparing strings.
acs_chars: '+\020\054\021-\030.^Y0\333`\004a\261f\370g\361h\260i\316j\331k\277l\332m\300n\305o~p\304q\304r\304s_t\303u\264v\301w\302x\263y\363z\362{\343|\330}\234~\376', '``aaffggiijjkkllmmnnooppqqrrssttuuvvwwxxyyzz{{||}}~~'.
clear_screen: '\E[H\E[J', '\E[H\E[2J'.
cursor_invisible: '\E[?25l\E[?1c', '\E[?25l'.
cursor_normal: '\E[?25h\E[?0c', '\E[?12l\E[?25h'.
cursor_visible: '\E[?25h\E[?8c', '\E[?12;25h'.
enter_alt_charset_mode: '\E[11m', '\E(0'.
exit_alt_charset_mode: '\E[10m', '\E(B'.
exit_attribute_mode: '\E[0;10m', '\E[m\E(B'.
flash_screen: '\E[?5h\E[?5l$<200/>', '\E[?5h$<100/>\E[?5l'.
key_b2: '\E[G', '\EOE'.
key_down: '\E[B', '\EOB'.
key_end: '\E[4~', '\EOF'.
key_f1: '\E[[A', '\EOP'.
key_f13: '\E[25~', '\EO2P'.
key_f14: '\E[26~', '\EO2Q'.
key_f15: '\E[28~', '\EO2R'.
key_f16: '\E[29~', '\EO2S'.
key_f17: '\E[31~', '\E[15;2~'.
key_f18: '\E[32~', '\E[17;2~'.
key_f19: '\E[33~', '\E[18;2~'.
key_f2: '\E[[B', '\EOQ'.
key_f20: '\E[34~', '\E[19;2~'.
key_f3: '\E[[C', '\EOR'.
key_f4: '\E[[D', '\EOS'.
key_f5: '\E[[E', '\E[15~'.
key_home: '\E[1~', '\EOH'.
key_left: '\E[D', '\EOD'.
key_right: '\E[C', '\EOC'.
key_up: '\E[A', '\EOA'.
reset_1string: '\Ec\E]R', '\Ec'.
set_attributes: '\E[0;10%?%p1%t;7%;%?%p2%t;4%;%?%p3%t;7%;%?%p4%t;5%;%?%p5%t;2%;%?%p6%t;1%;%?%p7%t;8%;%?%p9%t;11%;m', '\E[0%?%p6%t;1%;%?%p2%t;4%;%?%p1%p3%|%t;7%;%?%p4%t;5%;%?%p7%t;8%;m%?%p9%t\E(0%e\E(B%;'.
user8: '\E[?6c', '\E[?1;2c'.