void cfg_resize_histories(int new_size) { const int old_size = MAX(cfg.history_len, 0); hists_resize(new_size); flist_hist_resize(&lwin, new_size); flist_hist_resize(&rwin, new_size); cfg.history_len = new_size; if(old_size == 0 && new_size > 0) { flist_hist_save(&lwin, NULL, NULL, -1); flist_hist_save(&rwin, NULL, NULL, -1); } }
int stats_init(config_t *config) { inside_screen = !is_null_or_empty(env_get(SCREEN_ENVVAR)); inside_tmux = !is_null_or_empty(env_get(TMUX_ENVVAR)); load_def_values(&curr_stats, config); determine_fuse_umount_cmd(&curr_stats); set_gtk_available(&curr_stats); curr_stats.exec_env_type = get_exec_env_type(); stats_update_shell_type(config->shell); (void)hist_init(&curr_stats.cmd_hist, config->history_len); (void)hist_init(&curr_stats.search_hist, config->history_len); (void)hist_init(&curr_stats.prompt_hist, config->history_len); (void)hist_init(&curr_stats.filter_hist, config->history_len); hists_resize(config->history_len); return stats_reset(config); }