├── image.png ├── ssh-container ├── README.md └── Dockerfile ├── src ├── go.mod ├── go.sum ├── Makefile ├── index.html ├── main.go └── xterm.css ├── Dockerfile ├── .github └── workflows │ └── release.yml ├── LICENSE ├── docker-compose.yml └── README.md /image.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Razikus/go-ssh-to-websocket/HEAD/image.png -------------------------------------------------------------------------------- /ssh-container/README.md: -------------------------------------------------------------------------------- 1 | # Don't use it 2 | 3 | It exists just for development purposes -------------------------------------------------------------------------------- /src/go.mod: -------------------------------------------------------------------------------- 1 | module github.com/Razikus/go-ssh-to-websocket 2 | 3 | go 1.21.1 4 | 5 | require ( 6 | github.com/gorilla/websocket v1.5.1 7 | golang.org/x/crypto v0.22.0 8 | ) 9 | 10 | require ( 11 | golang.org/x/net v0.23.0 // indirect 12 | golang.org/x/sys v0.19.0 // indirect 13 | ) 14 | -------------------------------------------------------------------------------- /Dockerfile: -------------------------------------------------------------------------------- 1 | 2 | FROM golang:1.22.2-alpine3.19 AS builder 3 | COPY src /src 4 | WORKDIR /src 5 | RUN go build -o /sshtows 6 | 7 | FROM scratch 8 | COPY --from=builder /sshtows /sshtows 9 | COPY --from=builder /src/index.html /index.html 10 | COPY --from=builder /src/xterm.js /xterm.js 11 | COPY --from=builder /src/xterm.css /xterm.css 12 | 13 | EXPOSE 8280 14 | ENTRYPOINT [ "/sshtows" ] -------------------------------------------------------------------------------- /ssh-container/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM alpine:3.19 2 | 3 | RUN apk add --no-cache openssh-server 4 | 5 | RUN sed -i 's/#LogLevel INFO/LogLevel VERBOSE/' /etc/ssh/sshd_config 6 | RUN echo 'PermitUserEnvironment yes' >> /etc/ssh/sshd_config 7 | RUN sed -i 's/#PasswordAuthentication yes/PasswordAuthentication yes/' /etc/ssh/sshd_config 8 | RUN sed -i 's/#LogLevel INFO/LogLevel VERBOSE/' /etc/ssh/sshd_config 9 | RUN adduser -D admin 10 | RUN echo 'admin:admin123123' | chpasswd 11 | RUN cp /etc/ssh/sshd_config /config 12 | 13 | CMD ssh-keygen -A && /usr/sbin/sshd -f /config -D -e -------------------------------------------------------------------------------- /src/go.sum: -------------------------------------------------------------------------------- 1 | github.com/gorilla/websocket v1.5.1 h1:gmztn0JnHVt9JZquRuzLw3g4wouNVzKL15iLr/zn/QY= 2 | github.com/gorilla/websocket v1.5.1/go.mod h1:x3kM2JMyaluk02fnUJpQuwD2dCS5NDG2ZHL0uE0tcaY= 3 | golang.org/x/crypto v0.22.0 h1:g1v0xeRhjcugydODzvb3mEM9SQ0HGp9s/nh3COQ/C30= 4 | golang.org/x/crypto v0.22.0/go.mod h1:vr6Su+7cTlO45qkww3VDJlzDn0ctJvRgYbC2NvXHt+M= 5 | golang.org/x/net v0.23.0 h1:7EYJ93RZ9vYSZAIb2x3lnuvqO5zneoD6IvWjuhfxjTs= 6 | golang.org/x/net v0.23.0/go.mod h1:JKghWKKOSdJwpW2GEx0Ja7fmaKnMsbu+MWVZTokSYmg= 7 | golang.org/x/sys v0.19.0 h1:q5f1RH2jigJ1MoAWp2KTp3gm5zAGFUTarQZ5U386+4o= 8 | golang.org/x/sys v0.19.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= 9 | golang.org/x/term v0.19.0 h1:+ThwsDv+tYfnJFhF4L8jITxu1tdTWRTZpdsWgEgjL6Q= 10 | golang.org/x/term v0.19.0/go.mod h1:2CuTdWZ7KHSQwUzKva0cbMg6q2DMI3Mmxp+gKJbskEk= 11 | -------------------------------------------------------------------------------- /.github/workflows/release.yml: -------------------------------------------------------------------------------- 1 | name: Release 2 | 3 | on: 4 | push: 5 | tags: 6 | - 'v*' 7 | 8 | jobs: 9 | build: 10 | name: Build and Release 11 | runs-on: ubuntu-latest 12 | 13 | steps: 14 | - name: Check out code 15 | uses: actions/checkout@v2 16 | 17 | - name: Set up Go 18 | uses: actions/setup-go@v2 19 | with: 20 | go-version: 1.22 21 | 22 | - name: Determine Version 23 | id: determine_version 24 | run: echo ::set-output name=VERSION::$(echo "${{ github.ref }}" | sed 's,.*/\(.*\),\1,') 25 | 26 | 27 | - name: Build 28 | run: | 29 | cd src 30 | make all VERSION=${{ steps.determine_version.outputs.VERSION }} 31 | 32 | - name: Create Release 33 | if: startsWith(github.ref, 'refs/tags/') 34 | uses: softprops/action-gh-release@v2 35 | with: 36 | files: | 37 | src/bin/* 38 | env: 39 | GITHUB_TOKEN: ${{ secrets.TOKEN }} 40 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2024 Adam Raźniewski 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /docker-compose.yml: -------------------------------------------------------------------------------- 1 | 2 | version: '3' 3 | 4 | services: 5 | traefik: 6 | image: traefik:v2.5 7 | command: 8 | - "--log.level=DEBUG" 9 | - "--api.insecure=true" 10 | - "--providers.docker=true" 11 | - "--entrypoints.web.address=:80" 12 | ports: 13 | - "80:80" 14 | volumes: 15 | - "/var/run/docker.sock:/var/run/docker.sock" 16 | labels: 17 | - "traefik.enable=true" 18 | 19 | sshcontainer: 20 | build: 21 | context: ssh-container 22 | 23 | sshtows: 24 | image: docker.io/razikus/sshtows:1.0.1 25 | environment: 26 | SSH_USER: "admin" 27 | SSH_PASS: "admin123123" 28 | SSH_HOST: "sshcontainer" 29 | SSH_PORT: "22" 30 | labels: 31 | - "traefik.enable=true" 32 | - "traefik.http.routers.sshtows-websocket.rule=Path(`/ssh`)" 33 | - "traefik.http.routers.sshtows-websocket.entrypoints=web" 34 | - "traefik.http.routers.sshtows-websocket.middlewares=sshtows-stripprefix" 35 | - "traefik.http.routers.sshtows-static.rule=PathPrefix(`/`)" 36 | - "traefik.http.routers.sshtows-static.entrypoints=web" 37 | - "traefik.http.middlewares.sshtows-stripprefix.stripprefix.prefixes=/ssh" 38 | 39 | - "traefik.http.middlewares.auth.basicauth.users=admin:$$apr1$$ro0zs3dk$$q7CjVX8gtmOrspmhSj5ki0" # admin : admin 40 | - "traefik.http.routers.sshtows-websocket.middlewares=sshtows-stripprefix,auth" 41 | - "traefik.http.routers.sshtows-static.middlewares=auth" 42 | -------------------------------------------------------------------------------- /src/Makefile: -------------------------------------------------------------------------------- 1 | VERSION=dev 2 | BINARY_NAME=$(VERSION)_ssh2ws 3 | 4 | amd64: 5 | GOOS=linux GOARCH=amd64 go build -o bin/$(BINARY_NAME)_amd64 main.go 6 | 7 | amd64-static: 8 | CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -a -installsuffix cgo -o bin/$(BINARY_NAME)_amd64_static main.go 9 | 10 | arm32: 11 | GOOS=linux GOARCH=arm go build -o bin/$(BINARY_NAME)_arm32 main.go 12 | 13 | arm32-static: 14 | CGO_ENABLED=0 GOOS=linux GOARCH=arm go build -a -installsuffix cgo -o bin/$(BINARY_NAME)_arm32_static main.go 15 | 16 | arm64: 17 | GOOS=linux GOARCH=arm64 go build -o bin/$(BINARY_NAME)_arm64 main.go 18 | 19 | arm64-static: 20 | CGO_ENABLED=0 GOOS=linux GOARCH=arm64 go build -a -installsuffix cgo -o bin/$(BINARY_NAME)_arm64_static main.go 21 | 22 | windows: 23 | GOOS=windows GOARCH=amd64 go build -o bin/$(BINARY_NAME).exe main.go 24 | 25 | windows-static: 26 | CGO_ENABLED=0 GOOS=windows GOARCH=amd64 go build -a -installsuffix cgo -o bin/$(BINARY_NAME)_static.exe main.go 27 | 28 | darwin: 29 | GOOS=darwin GOARCH=amd64 go build -o bin/$(BINARY_NAME)_darwin main.go 30 | 31 | darwin-static: 32 | CGO_ENABLED=0 GOOS=darwin GOARCH=amd64 go build -a -installsuffix cgo -o bin/$(BINARY_NAME)_darwin_static main.go 33 | 34 | darwinarm64: 35 | GOOS=darwin GOARCH=arm64 go build -o bin/$(BINARY_NAME)_darwinarm64 main.go 36 | 37 | darwinarm64-static: 38 | CGO_ENABLED=0 GOOS=darwin GOARCH=arm64 go build -a -installsuffix cgo -o bin/$(BINARY_NAME)_darwinarm64_static main.go 39 | 40 | all: amd64 amd64-static arm32 arm32-static arm64 arm64-static windows windows-static darwin darwin-static darwinarm64 darwinarm64-static -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # GO SSH TO WEBSOCKET 2 | 3 | This project does exactly what it says 4 | 5 | It's an proxy written in GO that allows to connect to SSH server over WebSocket - just from your browser 6 | 7 | I wrote it for other project, but maybe will be useful for somebody 8 | 9 | 10 | ![GO SSH TO WEBSOCKET](https://raw.githubusercontent.com/Razikus/go-ssh-to-websocket/main/image.png) 11 | 12 | 13 | ## Features 14 | 15 | - SSH connection via WebSockets 16 | - Web-based terminal emulation using [xterm.js](https://xtermjs.org/) 17 | - Environment variable configuration for SSH credentials (password based) and settings 18 | - Dockerized 19 | 20 | ## Running in docker 21 | 22 | ``` 23 | 24 | docker run -p 8280:8280 -e SSH_USER=USER -e SSH_PASS=PASS -e SSH_HOST=HOST -e SSH_PORT=PORT --rm docker.io/razikus/sshtows:1.0.1 25 | 26 | ``` 27 | 28 | Go to http://localhost:8280 and you will see terminal 29 | 30 | ## Configuration 31 | 32 | Available env variables 33 | 34 | ``` 35 | SSH_USER="your_username" 36 | SSH_PASS="your_password" 37 | SSH_HOST="ssh.example.com" 38 | SSH_PORT="22" 39 | MOUNT_HTML="true" 40 | ``` 41 | 42 | ## Docker compose with basic auth and simple SSH container 43 | 44 | - 13.05.2024 - just added simple SSH container to make ability to log in inside the system out of the box. 45 | 46 | In docker-compose there is example how to setup basic proxy with basic auth 47 | 48 | In order to change credentials from default (admin : admin) user need to follow traefik tutorial 49 | ``` 50 | https://doc.traefik.io/traefik/middlewares/http/basicauth/ 51 | ``` 52 | 53 | Here you can create htpasswd online (remember to escape $ with $$) 54 | 55 | ``` 56 | https://hostingcanada.org/htpasswd-generator/ 57 | ``` 58 | -------------------------------------------------------------------------------- /src/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | SSH over WebSocket 6 | 12 | 13 | 14 |
15 | 16 | 53 | 54 | 55 | -------------------------------------------------------------------------------- /src/main.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import ( 4 | "fmt" 5 | "io" 6 | "log" 7 | "net/http" 8 | "os" 9 | 10 | "github.com/gorilla/websocket" 11 | "golang.org/x/crypto/ssh" 12 | ) 13 | 14 | var upgrader = websocket.Upgrader{ 15 | ReadBufferSize: 1024, 16 | WriteBufferSize: 1024, 17 | CheckOrigin: func(r *http.Request) bool { 18 | return true 19 | }, 20 | } 21 | 22 | func sshHandler(w http.ResponseWriter, r *http.Request) { 23 | user := os.Getenv("SSH_USER") 24 | pass := os.Getenv("SSH_PASS") 25 | host := os.Getenv("SSH_HOST") 26 | port := os.Getenv("SSH_PORT") 27 | 28 | hostport := fmt.Sprintf("%s:%s", host, port) 29 | 30 | wsConn, err := upgrader.Upgrade(w, r, nil) 31 | if err != nil { 32 | log.Println("Upgrade error:", err) 33 | return 34 | } 35 | defer wsConn.Close() 36 | 37 | config := &ssh.ClientConfig{ 38 | User: user, 39 | Auth: []ssh.AuthMethod{ 40 | ssh.Password(pass), 41 | }, 42 | HostKeyCallback: ssh.InsecureIgnoreHostKey(), 43 | } 44 | 45 | sshConn, err := ssh.Dial("tcp", hostport, config) 46 | if err != nil { 47 | log.Println("SSH dial error:", err) 48 | return 49 | } 50 | defer sshConn.Close() 51 | 52 | session, err := sshConn.NewSession() 53 | if err != nil { 54 | log.Println("SSH session error:", err) 55 | return 56 | } 57 | defer session.Close() 58 | 59 | sshOut, err := session.StdoutPipe() 60 | if err != nil { 61 | log.Println("STDOUT pipe error:", err) 62 | return 63 | } 64 | 65 | sshIn, err := session.StdinPipe() 66 | if err != nil { 67 | log.Println("STDIN pipe error:", err) 68 | return 69 | } 70 | 71 | if err := session.RequestPty("xterm", 80, 40, ssh.TerminalModes{}); err != nil { 72 | log.Println("Request PTY error:", err) 73 | return 74 | } 75 | 76 | if err := session.Shell(); err != nil { 77 | log.Println("Start shell error:", err) 78 | return 79 | } 80 | 81 | go func() { 82 | defer session.Close() 83 | buf := make([]byte, 1024) 84 | for { 85 | n, err := sshOut.Read(buf) 86 | if err != nil { 87 | if err != io.EOF { 88 | log.Println("Read from SSH stdout error:", err) 89 | } 90 | return 91 | } 92 | if n > 0 { 93 | err = wsConn.WriteMessage(websocket.BinaryMessage, buf[:n]) 94 | if err != nil { 95 | log.Println("Write to WebSocket error:", err) 96 | return 97 | } 98 | } 99 | } 100 | }() 101 | 102 | for { 103 | messageType, p, err := wsConn.ReadMessage() 104 | if err != nil { 105 | if err != io.EOF { 106 | log.Println("Read from WebSocket error:", err) 107 | } 108 | return 109 | } 110 | if messageType == websocket.BinaryMessage || messageType == websocket.TextMessage { 111 | _, err = sshIn.Write(p) 112 | if err != nil { 113 | log.Println("Write to SSH stdin error:", err) 114 | return 115 | } 116 | } 117 | } 118 | } 119 | 120 | func checkForVariables() error { 121 | if os.Getenv("SSH_USER") == "" { 122 | return fmt.Errorf("SSH_USER is not set") 123 | } 124 | if os.Getenv("SSH_PASS") == "" { 125 | return fmt.Errorf("SSH_PASS is not set") 126 | } 127 | if os.Getenv("SSH_HOST") == "" { 128 | return fmt.Errorf("SSH_HOST is not set") 129 | } 130 | if os.Getenv("SSH_PORT") == "" { 131 | return fmt.Errorf("SSH_PORT is not set") 132 | } 133 | return nil 134 | } 135 | 136 | func printUsage() { 137 | fmt.Println("Usage (set proper environmental variables): ") 138 | fmt.Println("SSH_USER - username for ssh connection") 139 | fmt.Println("SSH_PASS - password for ssh connection") 140 | fmt.Println("SSH_HOST - host for ssh connection") 141 | fmt.Println("SSH_PORT - port for ssh connection") 142 | fmt.Println("MOUNT_HTML - mount html files (default true, set to false to disable)") 143 | 144 | } 145 | func main() { 146 | errOf := checkForVariables() 147 | if errOf != nil { 148 | 149 | printUsage() 150 | log.Fatal(errOf) 151 | } 152 | shouldMountHTML := os.Getenv("MOUNT_HTML") == "true" || os.Getenv("MOUNT_HTML") == "" 153 | http.HandleFunc("/ssh", sshHandler) 154 | 155 | if shouldMountHTML { 156 | http.HandleFunc("/", func(w http.ResponseWriter, r *http.Request) { 157 | http.ServeFile(w, r, "index.html") 158 | }) 159 | http.HandleFunc("/xterm.css", func(w http.ResponseWriter, r *http.Request) { 160 | http.ServeFile(w, r, "xterm.css") 161 | }) 162 | http.HandleFunc("/xterm.js", func(w http.ResponseWriter, r *http.Request) { 163 | http.ServeFile(w, r, "xterm.js") 164 | }) 165 | } 166 | 167 | fmt.Println("Starting server on :8280") 168 | log.Fatal(http.ListenAndServe(":8280", nil)) 169 | 170 | } 171 | -------------------------------------------------------------------------------- /src/xterm.css: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2014 The xterm.js authors. All rights reserved. 3 | * Copyright (c) 2012-2013, Christopher Jeffrey (MIT License) 4 | * https://github.com/chjj/term.js 5 | * @license MIT 6 | * 7 | * Permission is hereby granted, free of charge, to any person obtaining a copy 8 | * of this software and associated documentation files (the "Software"), to deal 9 | * in the Software without restriction, including without limitation the rights 10 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 11 | * copies of the Software, and to permit persons to whom the Software is 12 | * furnished to do so, subject to the following conditions: 13 | * 14 | * The above copyright notice and this permission notice shall be included in 15 | * all copies or substantial portions of the Software. 16 | * 17 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 18 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 19 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 20 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 21 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 22 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 23 | * THE SOFTWARE. 24 | * 25 | * Originally forked from (with the author's permission): 26 | * Fabrice Bellard's javascript vt100 for jslinux: 27 | * http://bellard.org/jslinux/ 28 | * Copyright (c) 2011 Fabrice Bellard 29 | * The original design remains. The terminal itself 30 | * has been extended to include xterm CSI codes, among 31 | * other features. 32 | */ 33 | 34 | /** 35 | * Default styles for xterm.js 36 | */ 37 | 38 | .xterm { 39 | cursor: text; 40 | position: relative; 41 | user-select: none; 42 | -ms-user-select: none; 43 | -webkit-user-select: none; 44 | } 45 | 46 | .xterm.focus, 47 | .xterm:focus { 48 | outline: none; 49 | } 50 | 51 | .xterm .xterm-helpers { 52 | position: absolute; 53 | top: 0; 54 | /** 55 | * The z-index of the helpers must be higher than the canvases in order for 56 | * IMEs to appear on top. 57 | */ 58 | z-index: 5; 59 | } 60 | 61 | .xterm .xterm-helper-textarea { 62 | padding: 0; 63 | border: 0; 64 | margin: 0; 65 | /* Move textarea out of the screen to the far left, so that the cursor is not visible */ 66 | position: absolute; 67 | opacity: 0; 68 | left: -9999em; 69 | top: 0; 70 | width: 0; 71 | height: 0; 72 | z-index: -5; 73 | /** Prevent wrapping so the IME appears against the textarea at the correct position */ 74 | white-space: nowrap; 75 | overflow: hidden; 76 | resize: none; 77 | } 78 | 79 | .xterm .composition-view { 80 | /* TODO: Composition position got messed up somewhere */ 81 | background: #000; 82 | color: #FFF; 83 | display: none; 84 | position: absolute; 85 | white-space: nowrap; 86 | z-index: 1; 87 | } 88 | 89 | .xterm .composition-view.active { 90 | display: block; 91 | } 92 | 93 | .xterm .xterm-viewport { 94 | /* On OS X this is required in order for the scroll bar to appear fully opaque */ 95 | background-color: #000; 96 | overflow-y: scroll; 97 | cursor: default; 98 | position: absolute; 99 | right: 0; 100 | left: 0; 101 | top: 0; 102 | bottom: 0; 103 | } 104 | 105 | .xterm .xterm-screen { 106 | position: relative; 107 | } 108 | 109 | .xterm .xterm-screen canvas { 110 | position: absolute; 111 | left: 0; 112 | top: 0; 113 | } 114 | 115 | .xterm .xterm-scroll-area { 116 | visibility: hidden; 117 | } 118 | 119 | .xterm-char-measure-element { 120 | display: inline-block; 121 | visibility: hidden; 122 | position: absolute; 123 | top: 0; 124 | left: -9999em; 125 | line-height: normal; 126 | } 127 | 128 | .xterm.enable-mouse-events { 129 | /* When mouse events are enabled (eg. tmux), revert to the standard pointer cursor */ 130 | cursor: default; 131 | } 132 | 133 | .xterm.xterm-cursor-pointer, 134 | .xterm .xterm-cursor-pointer { 135 | cursor: pointer; 136 | } 137 | 138 | .xterm.column-select.focus { 139 | /* Column selection mode */ 140 | cursor: crosshair; 141 | } 142 | 143 | .xterm .xterm-accessibility, 144 | .xterm .xterm-message { 145 | position: absolute; 146 | left: 0; 147 | top: 0; 148 | bottom: 0; 149 | right: 0; 150 | z-index: 10; 151 | color: transparent; 152 | pointer-events: none; 153 | } 154 | 155 | .xterm .live-region { 156 | position: absolute; 157 | left: -9999px; 158 | width: 1px; 159 | height: 1px; 160 | overflow: hidden; 161 | } 162 | 163 | .xterm-dim { 164 | /* Dim should not apply to background, so the opacity of the foreground color is applied 165 | * explicitly in the generated class and reset to 1 here */ 166 | opacity: 1 !important; 167 | } 168 | 169 | .xterm-underline-1 { text-decoration: underline; } 170 | .xterm-underline-2 { text-decoration: double underline; } 171 | .xterm-underline-3 { text-decoration: wavy underline; } 172 | .xterm-underline-4 { text-decoration: dotted underline; } 173 | .xterm-underline-5 { text-decoration: dashed underline; } 174 | 175 | .xterm-overline { 176 | text-decoration: overline; 177 | } 178 | 179 | .xterm-overline.xterm-underline-1 { text-decoration: overline underline; } 180 | .xterm-overline.xterm-underline-2 { text-decoration: overline double underline; } 181 | .xterm-overline.xterm-underline-3 { text-decoration: overline wavy underline; } 182 | .xterm-overline.xterm-underline-4 { text-decoration: overline dotted underline; } 183 | .xterm-overline.xterm-underline-5 { text-decoration: overline dashed underline; } 184 | 185 | .xterm-strikethrough { 186 | text-decoration: line-through; 187 | } 188 | 189 | .xterm-screen .xterm-decoration-container .xterm-decoration { 190 | z-index: 6; 191 | position: absolute; 192 | } 193 | 194 | .xterm-screen .xterm-decoration-container .xterm-decoration.xterm-decoration-top-layer { 195 | z-index: 7; 196 | } 197 | 198 | .xterm-decoration-overview-ruler { 199 | z-index: 8; 200 | position: absolute; 201 | top: 0; 202 | right: 0; 203 | pointer-events: none; 204 | } 205 | 206 | .xterm-decoration-top { 207 | z-index: 2; 208 | position: relative; 209 | } 210 | --------------------------------------------------------------------------------