don't allow the history to grow too much + save_session refactoring add a mechanism that will signal a regeneration of the history file once it reaches the 150% of the HISTORY_CAP. while here refactor save_session, now it's somewhat readable.

unbreak history file I can't use the ""generate temp file + rename" trick used for the session file, because I only add items that are not "dirty". the history-on-disk things needs some improvements, mostly to limitate the size of the file, but for the time being unbreak it!

move load session stuff to session.c

generate session/history_file atomically if an i/o error occurs while writing those files, they may end up being corrupted or truncated. Use the approach already used for tofu, write a temp file and rename(2) it to the correct position.

merge the fs into the ui process The previous separation between the fs and ui process wasn't that good. The idea was to have a `ui' process tightly sandboxed, but it was a lie actually. `ui' was one imsg away from making internet connections and accessing data on the disk, so it wasn't really limited in (almost) any way. Furthermore, having to serialize data to/from the fs proc started to become not really maneagable. As a first step to fix this situation, join the fs and ui process.

persist list of visited URLs to the disk Persist a generalized history of visited URL in history_file and try to keep it in sync during telescope usage and shutdown.

initialize each tab loadingev timer event found on freebsd: closing a tab caused the message "event_pending: event has no event_base set" to be print.

doesn't need parser.h anymore

move TAB_LAZY flipping from switch_to_tab in load_url load_url needs to know when a tab passes from lazy to not lazy to correctly saves the scrolling position (see follow-up commit.)

save and restore scroll position Save the offset to the first and current line of the buffers and restore it when the page is loaded. This restores almost the exact viewport: we save the offset of the *real* line in the document, but they get wrapped before being displayed, so the actual restored position may be slightly above from the original one (think of a long paragraph that gets wrapped over multiple visual lines.) In practice, this isn't a drawback but only an improvement over the current behaviour. In the future we could save also the offset *inside* the line, to restore the exact position, but that felt unnecessary for now. Persisting the postion on the session file ensures that even when re-opening telescope the scroll position is correct. There are some very active pages, such as antenna or other aggregator, where this feature doesn't really work well if you re-open the page after a while, since new links are available, but otherwise is a god sent! See also github issue #1

fix glitch with tab-bar-show=1 and tab-undo-close a missing ui_schedule_redraw on unkill_tab means that the tabbar is not rendered when calling tab-undo-close when there is only one tab.

provide a way to bypass the cache This changes the last argument of load_url to be a `mode' bitmap instead of a boolean ``nohist''. LU_MODE_NOHIST is the old 1, LU_MODE_NONE is provided just for readability and the new LU_MODE_NOCACHE allows to bypass the caching when loading a page. Telescope only uses the cache when: - re-opens a closed tab - navigates backward and forward in the history All other situations result in the usual network request.

append killed tabs when parsing session to preserve the order The other option, less intrusive, would be to send the killed tabs in reverse order, but it'd seems strange when looking at the session file otherwise. So, add a `append' flag to kill_tab to optionally append the killed tab instead of pre-pending it.

fix outdated comment free_tab now operates exclusively on the killed tabs list, so don't mention the current_tab.

add double space at the end of the sentence