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

Setting hterm preferences? #17

Closed
rafi opened this issue Oct 15, 2016 · 6 comments
Closed

Setting hterm preferences? #17

rafi opened this issue Oct 15, 2016 · 6 comments

Comments

@rafi
Copy link

rafi commented Oct 15, 2016

I'm getting VM217:1 Uncaught ReferenceError: term_ is not defined
For example:

term_.prefs_.set('pref-name', 'pref-value')
term_.prefs_.set('background-color', '#002B36')
term_.prefs_.set('foreground-color', '#839496')
term_.prefs_.set('font-family', 'Menlo')
term_.prefs_.set('font-size', 12)
term_.prefs_.set('font-smoothing', 'subpixel-antialiased')

As per https://chromium.googlesource.com/chromiumos/platform/assets/+/factory-3004.B/chromeapps/hterm/doc/faq.txt#234

@tsl0922
Copy link
Owner

tsl0922 commented Oct 16, 2016

Are you doing this in javascript console of the browser? This is not supported as the hterm instance is not public.

I'm planning to add command-line options for setting hterm preference on the server side, the client interface is ok(receive options from websocket), but server side is not done currently.

@rafi
Copy link
Author

rafi commented Oct 16, 2016

Yes, I tried in the js console of browser as mentioned in the hterm docs.
Thank you for this project, it's awesome!

@tsl0922
Copy link
Owner

tsl0922 commented Oct 30, 2016

Hi @rafi , I've added command-line option (--client-option, -t) for sending hterm preferences to the client, try the latest master branch.

The -t option can be used like this:

  • -t font-size=20
  • -t foreground-color=blue
  • -t keybindings='{ "Ctrl-Alt-K": "clearScrollback","Ctrl-Shift-L": "PASS"}'
  • -t cursor-blink-cycle="[1000, 500]"

The option value can be a json string, or plain value. Use -t multiple times to send more options.

@oneleft
Copy link

oneleft commented Aug 2, 2018

The examples you provided do not work for me. I get the following error:

Uncaught Error: No option with key "font-size"
at s.setOption ((index):11)
at (index):20
at Array.forEach ()
at WebSocket.i.onmessage ((index):20)

I tried each of your examples verbatim and I get the same error each time.

I also visited the xterm manual link that you posted in response to a different issue.

Can you please provide a list of all the option keys as well as the type and range of values expected for each?

@tsl0922
Copy link
Owner

tsl0922 commented Aug 2, 2018

@oneleft ttyd uses xterm.js now, please view the link below to get the available options:

https://xtermjs.org/docs/api/terminal/interfaces/iterminaloptions/

example:

ttyd -t 'fontSize=30' bash

@oneleft
Copy link

oneleft commented Aug 2, 2018 via email

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

3 participants