Skip to content

Add title option to set the browser tab title#263

Open
r2evans wants to merge 1 commit into
nx10:masterfrom
r2evans:fix/232-set-title
Open

Add title option to set the browser tab title#263
r2evans wants to merge 1 commit into
nx10:masterfrom
r2evans:fix/232-set-title

Conversation

@r2evans

@r2evans r2evans commented Jul 10, 2026

Copy link
Copy Markdown

With several R processes each running a httpgd device, every browser tab is titled "httpgd" and there is no way to tell which tab belongs to which process.

hgd() gains a title argument (default getOption("httpgd.title", "httpgd")) and a new exported function hgd_title() renames a running device. The title is part of the server state: it is included in every state JSON (/state, /plots, /remove, /clear and the WebSocket broadcast), so connected clients pick up a rename immediately without reloading the page. Title-only changes do not touch upid, so they cannot trigger plot re-fetches. Clients connected to an older server that sends no title keep the "httpgd" default, and older clients ignore the extra JSON field, so both directions stay compatible.

Closes #232

This is useful to me because I often have multiple R sessions/processes, each with their own plot histories. I like to be able to confirm visually which tab is assigned to which R process immediately when looking at the browser tabs instead of inferring based on the plot contents.

With several R processes each running a httpgd device, every browser
tab is titled "httpgd" and there is no way to tell which tab belongs
to which process.

hgd() gains a `title` argument (default `getOption("httpgd.title",
"httpgd")`) and a new exported function hgd_title() renames a running
device. The title is part of the server state: it is included in every
state JSON (/state, /plots, /remove, /clear and the WebSocket
broadcast), so connected clients pick up a rename immediately without
reloading the page. Title-only changes do not touch upid, so they
cannot trigger plot re-fetches. Clients connected to an older server
that sends no title keep the "httpgd" default, and older clients
ignore the extra JSON field, so both directions stay compatible.

Closes nx10#232

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
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.

set the title?

1 participant