Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature request: custom webpage title #133

Closed
wdscxsj opened this issue Oct 23, 2018 · 10 comments
Closed

Feature request: custom webpage title #133

wdscxsj opened this issue Oct 23, 2018 · 10 comments

Comments

@wdscxsj
Copy link

wdscxsj commented Oct 23, 2018

It seems that ttyd always sets the webpage title to the full terminal command. It's distracting if the command is long, and sometimes reveals too much detail. Could we have an option to use a custom title like "demo"?

Invoking a "demo" script to hide the detail is an easy workaround, but doesn't feel as natural. Thanks for your great work.

@tsl0922
Copy link
Owner

tsl0922 commented Oct 25, 2018

I'm not going to add this, because you can always change title with shell script, for example:

echo -ne "\033]0;demo\007"

The string demo will be prepended to the page title.

@tsl0922 tsl0922 closed this as completed Oct 25, 2018
@wdscxsj
Copy link
Author

wdscxsj commented Oct 25, 2018

But how to set the title, not to make it even longer? And this doesn't seem to work inside a tmux session... Is there a client option for this?

@tsl0922
Copy link
Owner

tsl0922 commented Oct 25, 2018

Currently, the default title is always appended to the page title, I'm considering remove it when the terminal title is customized so that the page title will be on your control.

Again, there won't be an option to change the default title, because it may confuse people that the title may be changed later by a terminal program.

@wdscxsj
Copy link
Author

wdscxsj commented Oct 25, 2018

OK, thanks for your explanation. 👍

@wdscxsj
Copy link
Author

wdscxsj commented Oct 25, 2018

Sorry to bother again... I totally agree that the title shouldn't be changed from the executed command (e.g. a bash session), but it's not what I proposed. Isn't it better if the title can be controlled by ttyd, the "master" process? That is:

ttyd tmux new -A -s demo                # case 1
ttyd -t title=demo tmux new -A -s demo  # case 2

In case 1, the webpage title is a verbose tmux new -A -s demo, and gets longer easily.

In case 2, with an added client option or something, the webpage title is a succinct demo. Fully controlled by ttyd, not affected by what happens in the terminal session.

The point is, what you execute is largely a detail; what you mean makes the title line.

@tsl0922
Copy link
Owner

tsl0922 commented Oct 25, 2018

Well, I agree it is not flexible here, I will check how it behaves on other terminal applications.

-t is only used for xterm.js options for now, we need a new option for title.

@tsl0922 tsl0922 reopened this Oct 25, 2018
@XianwuLin
Copy link

Because I will use the ttyd to open multiple servers at the same time, I want to be able to customize the title like gotty, so I can distinguish which server is from the title. What should I do?

@BiatuAutMiahn
Copy link

Any Updates on this PR?

@archetype2142
Copy link

Still looking for this update

@tsl0922
Copy link
Owner

tsl0922 commented Jul 25, 2020

Added support on master, usage:

ttyd -t titleFixed=hello bash

@tsl0922 tsl0922 closed this as completed Jul 25, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants