SVI fc8ab952b5 d01 Удаление ошмётков графики %!s(int64=3) %!d(string=hai) anos
..
terminfo fc8ab952b5 d01 Удаление ошмётков графики %!s(int64=3) %!d(string=hai) anos
.appveyor.yml fc8ab952b5 d01 Удаление ошмётков графики %!s(int64=3) %!d(string=hai) anos
.gitignore fc8ab952b5 d01 Удаление ошмётков графики %!s(int64=3) %!d(string=hai) anos
.travis.yml fc8ab952b5 d01 Удаление ошмётков графики %!s(int64=3) %!d(string=hai) anos
AUTHORS fc8ab952b5 d01 Удаление ошмётков графики %!s(int64=3) %!d(string=hai) anos
CHANGESv2.md fc8ab952b5 d01 Удаление ошмётков графики %!s(int64=3) %!d(string=hai) anos
LICENSE fc8ab952b5 d01 Удаление ошмётков графики %!s(int64=3) %!d(string=hai) anos
README-wasm.md fc8ab952b5 d01 Удаление ошмётков графики %!s(int64=3) %!d(string=hai) anos
README.md fc8ab952b5 d01 Удаление ошмётков графики %!s(int64=3) %!d(string=hai) anos
TUTORIAL.md fc8ab952b5 d01 Удаление ошмётков графики %!s(int64=3) %!d(string=hai) anos
UKRAINE.md fc8ab952b5 d01 Удаление ошмётков графики %!s(int64=3) %!d(string=hai) anos
attr.go fc8ab952b5 d01 Удаление ошмётков графики %!s(int64=3) %!d(string=hai) anos
cell.go fc8ab952b5 d01 Удаление ошмётков графики %!s(int64=3) %!d(string=hai) anos
charset_stub.go fc8ab952b5 d01 Удаление ошмётков графики %!s(int64=3) %!d(string=hai) anos
charset_unix.go fc8ab952b5 d01 Удаление ошмётков графики %!s(int64=3) %!d(string=hai) anos
charset_windows.go fc8ab952b5 d01 Удаление ошмётков графики %!s(int64=3) %!d(string=hai) anos
color.go fc8ab952b5 d01 Удаление ошмётков графики %!s(int64=3) %!d(string=hai) anos
colorfit.go fc8ab952b5 d01 Удаление ошмётков графики %!s(int64=3) %!d(string=hai) anos
console_stub.go fc8ab952b5 d01 Удаление ошмётков графики %!s(int64=3) %!d(string=hai) anos
console_win.go fc8ab952b5 d01 Удаление ошмётков графики %!s(int64=3) %!d(string=hai) anos
doc.go fc8ab952b5 d01 Удаление ошмётков графики %!s(int64=3) %!d(string=hai) anos
encoding.go fc8ab952b5 d01 Удаление ошмётков графики %!s(int64=3) %!d(string=hai) anos
errors.go fc8ab952b5 d01 Удаление ошмётков графики %!s(int64=3) %!d(string=hai) anos
event.go fc8ab952b5 d01 Удаление ошмётков графики %!s(int64=3) %!d(string=hai) anos
interrupt.go fc8ab952b5 d01 Удаление ошмётков графики %!s(int64=3) %!d(string=hai) anos
key.go fc8ab952b5 d01 Удаление ошмётков графики %!s(int64=3) %!d(string=hai) anos
mouse.go fc8ab952b5 d01 Удаление ошмётков графики %!s(int64=3) %!d(string=hai) anos
nonblock_bsd.go fc8ab952b5 d01 Удаление ошмётков графики %!s(int64=3) %!d(string=hai) anos
nonblock_unix.go fc8ab952b5 d01 Удаление ошмётков графики %!s(int64=3) %!d(string=hai) anos
paste.go fc8ab952b5 d01 Удаление ошмётков графики %!s(int64=3) %!d(string=hai) anos
resize.go fc8ab952b5 d01 Удаление ошмётков графики %!s(int64=3) %!d(string=hai) anos
runes.go fc8ab952b5 d01 Удаление ошмётков графики %!s(int64=3) %!d(string=hai) anos
screen.go fc8ab952b5 d01 Удаление ошмётков графики %!s(int64=3) %!d(string=hai) anos
simulation.go fc8ab952b5 d01 Удаление ошмётков графики %!s(int64=3) %!d(string=hai) anos
stdin_unix.go fc8ab952b5 d01 Удаление ошмётков графики %!s(int64=3) %!d(string=hai) anos
style.go fc8ab952b5 d01 Удаление ошмётков графики %!s(int64=3) %!d(string=hai) anos
terms_default.go fc8ab952b5 d01 Удаление ошмётков графики %!s(int64=3) %!d(string=hai) anos
terms_dynamic.go fc8ab952b5 d01 Удаление ошмётков графики %!s(int64=3) %!d(string=hai) anos
terms_static.go fc8ab952b5 d01 Удаление ошмётков графики %!s(int64=3) %!d(string=hai) anos
tscreen.go fc8ab952b5 d01 Удаление ошмётков графики %!s(int64=3) %!d(string=hai) anos
tscreen_stub.go fc8ab952b5 d01 Удаление ошмётков графики %!s(int64=3) %!d(string=hai) anos
tscreen_unix.go fc8ab952b5 d01 Удаление ошмётков графики %!s(int64=3) %!d(string=hai) anos
tty.go fc8ab952b5 d01 Удаление ошмётков графики %!s(int64=3) %!d(string=hai) anos
tty_unix.go fc8ab952b5 d01 Удаление ошмётков графики %!s(int64=3) %!d(string=hai) anos
wscreen.go fc8ab952b5 d01 Удаление ошмётков графики %!s(int64=3) %!d(string=hai) anos

README-wasm.md

WASM for Tcell

You can build Tcell project into a webpage by compiling it slightly differently. This will result in a Tcell project you can embed into another html page, or use as a standalone page.

Building your project

WASM needs special build flags in order to work. You can build it by executing

GOOS=js GOARCH=wasm go build -o yourfile.wasm

Additional files

You also need 5 other files in the same directory as the wasm. Four (tcell.html, tcell.js, termstyle.css, and beep.wav) are provided in the webfiles directory. The last one, wasm_exec.js, can be copied from GOROOT into the current directory by executing

cp "$(go env GOROOT)/misc/wasm/wasm_exec.js" ./

In tcell.js, you also need to change the constant

const wasmFilePath = "yourfile.wasm"

to the file you outputed to when building.

Displaying your project

Standalone

You can see the project (with an white background around the terminal) by serving the directory. You can do this using any framework, including another golang project:

// server.go

package main

import (
	"log"
	"net/http"
)

func main() {
	log.Fatal(http.ListenAndServe(":8080",
		http.FileServer(http.Dir("/path/to/dir/to/serve")),
	))
}

To see the webpage with this example, you can type in localhost:8080/tcell.html into your browser while server.go is running.

Embedding

It is recomended to use an iframe if you want to embed the app into a webpage:

<iframe src="tcell.html" title="Tcell app"></iframe>

Other considerations

Accessing files

io.Open(filename) and other related functions for reading file systems do not work; use http.Get(filename) instead.