Giter Site home page Giter Site logo

Setting hterm preferences? about ttyd HOT 6 CLOSED

tsl0922 avatar tsl0922 commented on August 17, 2024
Setting hterm preferences?

from ttyd.

Comments (6)

tsl0922 avatar tsl0922 commented on August 17, 2024

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.

from ttyd.

rafi avatar rafi commented on August 17, 2024

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

from ttyd.

tsl0922 avatar tsl0922 commented on August 17, 2024

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.

from ttyd.

oneleft avatar oneleft commented on August 17, 2024

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?

from ttyd.

tsl0922 avatar tsl0922 commented on August 17, 2024

@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

from ttyd.

oneleft avatar oneleft commented on August 17, 2024

from ttyd.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.