unibilium.h(3)
β¨ unibilium.h β¨ β the manual, bestie edition π
unibilium.h β ncurses terminfo parser and utility functions π«Ά
π NAME π
unibilium.h β a header that gives you ncurses terminfo parsing plus a whole lil toolkit of utility functions. iykyk π
πΈ SYNOPSIS πΈ
#include <unibilium.h>
π DESCRIPTION π
okay so listen. this library hands you functions and types so you can go poke at terminal descriptions living in the terminfo database β yes, the one in the format ncurses uses, no cap.
it can do three whole things and they're all iconic:
- parse compiled terminfo entries β from memory or from files, dealer's choice β¨
- access and modify their capabilities β read 'em, change 'em, whatever
- generate brand new terminfo entries β yes bestie, you can make them π
π Types π
here's the type lineup, and every single one of them ate:
unibi_term
the main character. π it represents one terminfo entry, and most functions take a pointer to this structure. so likeβ¦ get familiar.
unibi_var_t
this one represents the values that show up in format string operations, and those values are either integers or strings. its exact representation is unspecified β do not come for its internal layout, it's mysterious on purpose π
see unibi_var_from_num(3), unibi_var_from_str(3), unibi_num_from_var(3), and unibi_str_from_var(3) for how to actually use values of this type.
but here's a guarantee that slays: zero-initializing aunibi_var_tis equivalent tounibi_var_from_num(0). periodt.
enum unibi_boolean
an enumeration of boolean capabilities. it has these elements, and there are a lot of them, so buckle up buttercup π¦:
unibi_auto_left_marginunibi_auto_right_marginunibi_no_esc_ctlcunibi_ceol_standout_glitchunibi_eat_newline_glitchunibi_erase_overstrikeunibi_generic_typeunibi_hard_copyunibi_has_meta_keyunibi_has_status_lineunibi_insert_null_glitchunibi_memory_aboveunibi_memory_belowunibi_move_insert_modeunibi_move_standout_modeunibi_over_strikeunibi_status_line_esc_okunibi_dest_tabs_magic_smsounibi_tilde_glitchunibi_transparent_underlineunibi_xon_xoffunibi_needs_xon_xoffunibi_prtr_silentunibi_hard_cursorunibi_non_rev_rmcupunibi_no_pad_charunibi_non_dest_scroll_regionunibi_can_changeunibi_back_color_eraseunibi_hue_lightness_saturationunibi_col_addr_glitchunibi_cr_cancels_micro_modeunibi_has_print_wheelunibi_row_addr_glitchunibi_semi_auto_right_marginunibi_cpi_changes_resunibi_lpi_changes_resunibi_backspaces_with_bsunibi_crt_no_scrollingunibi_no_correctly_working_crunibi_gnu_has_meta_keyunibi_linefeed_is_newlineunibi_has_hardware_tabsunibi_return_does_clr_eol
and then there are two special values, unibi_boolean_begin_ and unibi_boolean_end_, and they exist purely to make your life easier when you want to loop over every boolean capability. the way that works: every single enum value listed up there is greater than unibi_boolean_begin_ and less than unibi_boolean_end_. loop away bestie π
enum unibi_numeric
an enumeration of numeric capabilities. here's the full roster, no skipping π:
unibi_columnsunibi_init_tabsunibi_linesunibi_lines_of_memoryunibi_magic_cookie_glitchunibi_padding_baud_rateunibi_virtual_terminalunibi_width_status_lineunibi_num_labelsunibi_label_heightunibi_label_widthunibi_max_attributesunibi_maximum_windowsunibi_max_colorsunibi_max_pairsunibi_no_color_videounibi_buffer_capacityunibi_dot_vert_spacingunibi_dot_horz_spacingunibi_max_micro_addressunibi_max_micro_jumpunibi_micro_col_sizeunibi_micro_line_sizeunibi_number_of_pinsunibi_output_res_charunibi_output_res_lineunibi_output_res_horz_inchunibi_output_res_vert_inchunibi_print_rateunibi_wide_char_sizeunibi_buttonsunibi_bit_image_entwiningunibi_bit_image_typeunibi_magic_cookie_glitch_ulunibi_carriage_return_delayunibi_new_line_delayunibi_backspace_delayunibi_horizontal_tab_delayunibi_number_of_function_keys
same deal as the booleans, because symmetry is everything: the special values unibi_numeric_begin_ and unibi_numeric_end_ are there so programs can loop over all numeric capabilities. all of the enum values above are greater than unibi_numeric_begin_ and less than unibi_numeric_end_. chef's kiss π¨βπ³π
enum unibi_string
an enumeration of string capabilities. it has the following elements, and bestieβ¦ it's giving long, so here we go π:
π the OGs: movement, tabs & screen stuff
unibi_back_tabunibi_bellunibi_carriage_returnunibi_change_scroll_regionunibi_clear_all_tabsunibi_clear_screenunibi_clr_eolunibi_clr_eosunibi_column_addressunibi_command_characterunibi_cursor_addressunibi_cursor_downunibi_cursor_homeunibi_cursor_invisibleunibi_cursor_leftunibi_cursor_mem_addressunibi_cursor_normalunibi_cursor_rightunibi_cursor_to_llunibi_cursor_upunibi_cursor_visible
like, the absolute foundation of terminal life π every cursor that ever slid across your screen owes these ones a thank-you note.
βοΈ editing the screen, deleting & inserting
unibi_delete_characterunibi_delete_lineunibi_dis_status_lineunibi_down_half_line
short lil group, but so important β this is where the screen starts changing instead of just moving around π
π enter the modes (the glow-up era)
unibi_enter_alt_charset_modeunibi_enter_blink_modeunibi_enter_bold_modeunibi_enter_ca_modeunibi_enter_delete_modeunibi_enter_dim_modeunibi_enter_insert_modeunibi_enter_secure_modeunibi_enter_protected_modeunibi_enter_reverse_modeunibi_enter_standout_modeunibi_enter_underline_mode
bold, blink, underline, reverse, dimβ¦ it's giving makeover montage π all the ways a terminal can serve lewks, bestie.
πͺ exit the modes (leaving the party)
unibi_erase_charsunibi_exit_alt_charset_modeunibi_exit_attribute_modeunibi_exit_ca_modeunibi_exit_delete_modeunibi_exit_insert_modeunibi_exit_standout_modeunibi_exit_underline_modeunibi_flash_screenunibi_form_feedunibi_from_status_line
you can't stay in the club forever π every enter has an exit, that's the law. also unibi_flash_screen is exactly the dramatic one you think it is π
π init & reset (the "get ready" era)
unibi_init_1stringunibi_init_2stringunibi_init_3stringunibi_init_fileunibi_insert_characterunibi_insert_lineunibi_insert_padding
the numbered ones (1string, 2string, 3string) are literally the setup sequence, in order, no skipping β¨
β¨οΈ KEYS β the whole entire keyboard basically
unibi_key_backspaceunibi_key_catabunibi_key_clearunibi_key_ctabunibi_key_dcunibi_key_dlunibi_key_downunibi_key_eicunibi_key_eolunibi_key_eosunibi_key_f0unibi_key_f1unibi_key_f10unibi_key_f2unibi_key_f3unibi_key_f4unibi_key_f5unibi_key_f6unibi_key_f7unibi_key_f8unibi_key_f9unibi_key_homeunibi_key_icunibi_key_ilunibi_key_leftunibi_key_llunibi_key_npageunibi_key_ppageunibi_key_rightunibi_key_sfunibi_key_srunibi_key_stabunibi_key_upunibi_keypad_localunibi_keypad_xmit
and yes, unibi_key_f0 is right there vibing before unibi_key_f1, because that's how the list goes and we do not argue with the list π
π·οΈ the label crew
unibi_lab_f0unibi_lab_f1unibi_lab_f10unibi_lab_f2unibi_lab_f3unibi_lab_f4unibi_lab_f5unibi_lab_f6unibi_lab_f7unibi_lab_f8unibi_lab_f9
yeah f10 comes before f2, don't look at me, I didn't write the terminfo tables π
π«Ά odds & ends (meta, newline, padding)
unibi_meta_offunibi_meta_onunibi_newlineunibi_pad_char
ποΈ the parm_* squad (parameterized, main character energy)
unibi_parm_dchunibi_parm_delete_lineunibi_parm_down_cursorunibi_parm_ichunibi_parm_indexunibi_parm_insert_lineunibi_parm_left_cursorunibi_parm_right_cursorunibi_parm_rindexunibi_parm_up_cursor
these are the ones that take an argument β like "go down N" instead of just "go down once". they're the flexible besties of the group β¨
π¨οΈ printing & the printer era
unibi_pkey_keyunibi_pkey_localunibi_pkey_xmitunibi_print_screenunibi_prtr_offunibi_prtr_onunibi_repeat_charunibi_reset_1stringunibi_reset_2stringunibi_reset_3stringunibi_reset_fileunibi_restore_cursorunibi_row_addressunibi_save_cursorunibi_scroll_forwardunibi_scroll_reverseunibi_set_attributesunibi_set_tabunibi_set_windowunibi_tabunibi_to_status_lineunibi_underline_charunibi_up_half_lineunibi_init_prog
(yes unibi_init_prog is chilling way down here, all by itself, and that's just where it lives π¦)
π€ the stragglers that joined later
unibi_key_a1unibi_key_a3unibi_key_b2unibi_key_c1unibi_key_c3unibi_prtr_nonunibi_char_paddingunibi_acs_charsunibi_plab_normunibi_key_btabunibi_enter_xon_modeunibi_exit_xon_modeunibi_enter_am_modeunibi_exit_am_modeunibi_xon_characterunibi_xoff_characterunibi_ena_acsunibi_label_onunibi_label_off
π±οΈ the function-key-name keys (round two, electric boogaloo)
unibi_key_begunibi_key_cancelunibi_key_closeunibi_key_commandunibi_key_copyunibi_key_createunibi_key_endunibi_key_enterunibi_key_exitunibi_key_findunibi_key_helpunibi_key_markunibi_key_messageunibi_key_moveunibi_key_nextunibi_key_openunibi_key_optionsunibi_key_previousunibi_key_printunibi_key_redounibi_key_referenceunibi_key_refreshunibi_key_replaceunibi_key_restartunibi_key_resumeunibi_key_saveunibi_key_suspendunibi_key_undo
π©· and the shift versions of basically all of those
unibi_key_sbegunibi_key_scancelunibi_key_scommandunibi_key_scopyunibi_key_screateunibi_key_sdcunibi_key_sdlunibi_key_selectunibi_key_sendunibi_key_seolunibi_key_sexitunibi_key_sfindunibi_key_shelpunibi_key_shomeunibi_key_sicunibi_key_sleftunibi_key_smessageunibi_key_smoveunibi_key_snextunibi_key_soptionsunibi_key_spreviousunibi_key_sprintunibi_key_sredounibi_key_sreplaceunibi_key_srightunibi_key_srsumeunibi_key_ssaveunibi_key_ssuspendunibi_key_sundounibi_req_for_input
π f11 through f63. all of them. count if you want.
unibi_key_f11unibi_key_f12unibi_key_f13unibi_key_f14unibi_key_f15unibi_key_f16unibi_key_f17unibi_key_f18unibi_key_f19unibi_key_f20unibi_key_f21unibi_key_f22unibi_key_f23unibi_key_f24unibi_key_f25unibi_key_f26unibi_key_f27unibi_key_f28unibi_key_f29unibi_key_f30unibi_key_f31unibi_key_f32unibi_key_f33unibi_key_f34unibi_key_f35unibi_key_f36unibi_key_f37unibi_key_f38unibi_key_f39unibi_key_f40unibi_key_f41unibi_key_f42unibi_key_f43unibi_key_f44unibi_key_f45unibi_key_f46unibi_key_f47unibi_key_f48unibi_key_f49unibi_key_f50unibi_key_f51unibi_key_f52unibi_key_f53unibi_key_f54unibi_key_f55unibi_key_f56unibi_key_f57unibi_key_f58unibi_key_f59unibi_key_f60unibi_key_f61unibi_key_f62unibi_key_f63
ngl bestie, the dedication? immaculate. whoever typed these out one by one deserves a nap and a snack π
π margins, labels, clocks & windows
unibi_clr_bolunibi_clear_marginsunibi_set_left_marginunibi_set_right_marginunibi_label_formatunibi_set_clockunibi_display_clockunibi_remove_clockunibi_create_windowunibi_goto_windowunibi_hangupunibi_dial_phoneunibi_quick_dialunibi_toneunibi_pulseunibi_flash_hookunibi_fixed_pauseunibi_wait_toneunibi_user0unibi_user1unibi_user2unibi_user3unibi_user4unibi_user5unibi_user6unibi_user7unibi_user8unibi_user9
okay the phone-dialing ones (unibi_dial_phone, unibi_quick_dial, unibi_hangup, unibi_flash_hook) are genuinely sending me π like this library was ready for your landline era, periodt.
π¨ colors, color pairs & the whole palette situation
unibi_orig_pairunibi_orig_colorsunibi_initialize_colorunibi_initialize_pairunibi_set_color_pairunibi_set_foregroundunibi_set_background
π¨οΈβ¨ printer / font / micro-mode arc (a LOT of these)
unibi_change_char_pitchunibi_change_line_pitchunibi_change_res_horzunibi_change_res_vertunibi_define_charunibi_enter_doublewide_modeunibi_enter_draft_qualityunibi_enter_italics_modeunibi_enter_leftward_modeunibi_enter_micro_modeunibi_enter_near_letter_qualityunibi_enter_normal_qualityunibi_enter_shadow_modeunibi_enter_subscript_modeunibi_enter_superscript_modeunibi_enter_upward_modeunibi_exit_doublewide_modeunibi_exit_italics_modeunibi_exit_leftward_modeunibi_exit_micro_modeunibi_exit_shadow_modeunibi_exit_subscript_modeunibi_exit_superscript_modeunibi_exit_upward_modeunibi_micro_column_addressunibi_micro_downunibi_micro_leftunibi_micro_rightunibi_micro_row_addressunibi_micro_upunibi_order_of_pinsunibi_parm_down_microunibi_parm_left_microunibi_parm_right_microunibi_parm_up_microunibi_select_char_setunibi_set_bottom_marginunibi_set_bottom_margin_parmunibi_set_left_margin_parmunibi_set_right_margin_parmunibi_set_top_marginunibi_set_top_margin_parmunibi_start_bit_imageunibi_start_char_set_defunibi_stop_bit_imageunibi_stop_char_set_defunibi_subscript_charactersunibi_superscript_charactersunibi_these_cause_crunibi_zero_motionunibi_char_set_namesunibi_key_mouseunibi_mouse_infounibi_req_mouse_posunibi_get_mouseunibi_set_a_foregroundunibi_set_a_backgroundunibi_pkey_plabunibi_device_typeunibi_code_set_initunibi_set0_des_sequnibi_set1_des_sequnibi_set2_des_sequnibi_set3_des_sequnibi_set_lr_marginunibi_set_tb_marginunibi_bit_image_repeatunibi_bit_image_newlineunibi_bit_image_carriage_returnunibi_color_namesunibi_define_bit_image_regionunibi_end_bit_image_regionunibi_set_color_bandunibi_set_page_lengthunibi_display_pc_charunibi_enter_pc_charset_modeunibi_exit_pc_charset_modeunibi_enter_scancode_modeunibi_exit_scancode_modeunibi_pc_term_optionsunibi_scancode_escapeunibi_alt_scancode_esc
look at all these, bestie β bit images, scancodes, char sets, the mouse ones, all of it, slaying in alphabetical-ish order π no cap, this list is the whole vibe of "terminals can do so much more than you think".
unibi_enter_horizontal_hl_modeunibi_enter_left_hl_modeunibi_enter_low_hl_modeunibi_enter_right_hl_modeunibi_enter_top_hl_modeunibi_enter_vertical_hl_modeunibi_set_a_attributesunibi_set_pglen_inchunibi_termcap_init2unibi_termcap_resetunibi_linefeed_if_not_lfunibi_backspace_if_not_bsunibi_other_non_function_keysunibi_arrow_key_mapunibi_acs_ulcornerunibi_acs_llcornerunibi_acs_urcornerunibi_acs_lrcornerunibi_acs_lteeunibi_acs_rteeunibi_acs_bteeunibi_acs_tteeunibi_acs_hlineunibi_acs_vlineunibi_acs_plusunibi_memory_lockunibi_memory_unlockunibi_box_chars_1
likeβ¦ that's the whole roster, we're done, breathe π«Ά
And okay, here's the bit that makes looping actually possible instead of a nightmare: there are two special values, unibi_string_begin_ and unibi_string_end_, and they exist specifically so your program can just cruise through every single string capability without hardcoding a list. Every one of the enum values listed above is greater than unibi_string_begin_ and less than unibi_string_end_. So likeβ¦ it's giving for loop, bestie. It's giving range. π
π SEE ALSO π
go read these too, they're all part of the same little family:
terminfo(5)unibi_dummy(3)unibi_from_mem(3)unibi_destroy(3)unibi_dump(3)unibi_get_name(3)unibi_set_name(3)unibi_get_aliases(3)unibi_set_aliases(3)unibi_get_bool(3)unibi_set_bool(3)unibi_get_num(3)unibi_set_num(3)unibi_get_str(3)unibi_set_str(3)unibi_from_fp(3)unibi_from_fd(3)unibi_from_file(3)unibi_from_term(3)unibi_from_env(3)unibi_terminfo_dirs(3)unibi_name_bool(3)unibi_short_name_bool(3)unibi_name_num(3)unibi_short_name_num(3)unibi_name_str(3)unibi_short_name_str(3)unibi_count_ext_bool(3)unibi_count_ext_num(3)unibi_count_ext_str(3)unibi_get_ext_bool(3)unibi_get_ext_num(3)unibi_get_ext_str(3)unibi_set_ext_bool(3)unibi_set_ext_num(3)unibi_set_ext_str(3)unibi_get_ext_bool_name(3)unibi_get_ext_num_name(3)unibi_get_ext_str_name(3)unibi_set_ext_bool_name(3)unibi_set_ext_num_name(3)unibi_set_ext_str_name(3)unibi_add_ext_bool(3)unibi_add_ext_num(3)unibi_add_ext_str(3)unibi_del_ext_bool(3)unibi_del_ext_num(3)unibi_del_ext_str(3)unibi_var_from_num(3)unibi_var_from_str(3)unibi_num_from_var(3)unibi_str_from_var(3)unibi_format(3)unibi_run(3)
and that's a wrap on the whole page!! π This one ships as unibilium-2.1.4, dated 2026-09-07, and it lives in section 3 of the manual β so you'll find it filed under unibilium.h(3). go forth and make terminals pretty β¨ππ¦
π¦ where this page comes from
- fedora 44: unibilium-devel 2.1.4-1.fc44 Β· LGPL-3.0-or-later
- fedora 44: unibilium-devel 2.1.4-1.fc44 Β· LGPL-3.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms