Skip to content

Add ability to toggle off welcome message#514

Open
jg791 wants to merge 4 commits intoocaml-community:masterfrom
jg791:toggle-welcome-message
Open

Add ability to toggle off welcome message#514
jg791 wants to merge 4 commits intoocaml-community:masterfrom
jg791:toggle-welcome-message

Conversation

@jg791
Copy link
Copy Markdown

@jg791 jg791 commented May 1, 2026

I prefer running utop as a stripped down interpreter in the shell, which is mostly achievable with the existing configuration options. However, the welcome message tends to take up space and "break" if you resize a terminal window. This PR adds a handy config option, UTop.set_show_welcome to disable it (similar to UTop.set_show_box), while still defaulting to an "enabled" setting to preserve backwards compatibility.

The README and man pages are updated accordingly.

@jg791 jg791 requested a review from rgrinberg as a code owner May 1, 2026 01:54
@jg791
Copy link
Copy Markdown
Author

jg791 commented May 1, 2026

image

Screenshot of starting utop with the following in ~/.config/utop/init.ml:

#utop_prompt_dummy;;
UTop.set_show_box false;;
UTop.set_show_welcome false;;

Comment thread src/lib/uTop_main.ml
(* Common initialization. *)
common_init ~initial_env;
(* Display a welcome message, if enabled. *)
if UTop.get_show_welcome () then Lwt_main.run (welcome term);
Copy link
Copy Markdown
Author

@jg791 jg791 May 2, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Moved so that the initialization is loaded before showing the welcome. Otherwise, the instructions in init.ml are ignored when deciding if we show the welcome message.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant