Comments (14)
@AGhost-7 @tsl0922
OK, I played with this around and I can be certain that we can't use CSS to control font in the terminal, since everything is now drawn into canvas elements in xterm.js.
However changing font
attribute of canvas element on the fly doesn't have any effect either.
The correct way to do it is via the -t, --client-option
option. I read source code to learn option keys then I started a terminal with:
ttyd -p 9090 -t fontSize=16 -t fontFamily="'IBM Plex Mono Medium', 'Noto Sans CJK SC'" fish
and it works perfectly.
from ttyd.
ttyd bundles a inlined index.html
to it's executable file, no other external dependencies, You can modify and build your own index.html
and rebuild ttyd if you want, see the instructions.
I'd like to add an option for using an external index.html
or html root for this, but no deadline, I'm a little busy recently, PRs are welcomed 😄
from ttyd.
That's is what I did - I forked the project for now but I feel this is more of a temporary solution.
I'm afraid that C
is not something that I'm very good at.
from ttyd.
+1
from ttyd.
Added the --index
option for this (c9ffa8a).
Be aware that only external index.html
file is supported, not html root.
from ttyd.
While I appreciate the feature which was added, its currently easier to just fork and use the gulp build in ttyd to customize the terminal instead of using the new --index
option. If I use the --index
option which was added I need to provide my own build script to generate the one html file.
What I am looking for is something closer to what you'd see in a regular terminal - more along the lines of being able to set terminal profiles.
from ttyd.
I don't think recompile index.html
is needed if you just want to change something like font-family, since your can add your own css block to override any existed class.
from ttyd.
@tsl0922 Which element should we set font-family upon? Is it a canvas element?
from ttyd.
Great! This feature wasn't well documented, there is similar issues I've answered before (like #122, #134).
You can get the full list of options here:
https://xtermjs.org/docs/api/terminal/interfaces/iterminaloptions/
from ttyd.
hmm no, tls0922: you should put an option for background/foreground color without the need to write a css or modify the index.html
from ttyd.
IMHO hterm is way better anyways... I use it extensively and is very easy to manage...
from ttyd.
Hi, @Zibri you can custom the full color scheme with -t, --client-option
. For example, to change the background/foreground:
ttyd -t 'theme={"foreground":"green","background":"cyan"}' bash
The code above only override the foreground/background color, you can get a full list of the predefined colors here.
from ttyd.
-t fontSize=16 -t fontFamily="'IBM Plex Mono Medium', 'Noto Sans CJK SC'"
I gave it another go today... and I still have a problem:
even though I used: --terminal-type xterm-256color
in linux I see the correct terminal type but there is no color.
why is that?
I tried both /bin/login both /bash -i -l
from ttyd.
Folks, I had built a forked version that has embedded nerd font. You can also replace your font.
https://github.com/metorm/ttyd-nerd-font
https://www.weiran.ink/oss/ttyd-with-nerd-font.html
from ttyd.
Related Issues (20)
- Feature: web-based port forwarding for http services HOT 1
- Non-ASCII characters lost in tmux HOT 7
- Ability to set disableLeaveAlert=true in query string HOT 19
- How to identify if shell is inactive HOT 1
- Caddyfile example HOT 1
- ttyd server does not respond to user input HOT 1
- how to make it can get .gitconfig HOT 3
- Start command before connection is made HOT 3
- mbedtls_ssl_conf_alpn_protocols absent HOT 1
- SSL certificate and key for uhttpd on OpenWrt are not recognized. HOT 2
- No reply to commands for ttyd running at win10 HOT 2
- ttyd crashes on windows HOT 4
- Safari 17 Does Not Load WebSockets, TTYD 1.7.4 (ARM) Will Not Load HOT 8
- Query command HOT 1
- Why can't ttyd let the browser save passwords? HOT 1
- Resume publishing SHA256SUMS HOT 1
- Integration with dockerized alpine HOT 1
- Fonts being displayed incorrectly HOT 2
- Attach to process HOT 1
- message to user on max-client HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ttyd.