MCPcopy Create free account
hub / github.com/coder/ghostty-web / setOption

Method setOption

lib/ghostty.ts:175–181  ·  view source on GitHub ↗
(option: KeyEncoderOption, value: boolean | number)

Source from the content-addressed store, hash-verified

173 }
174
175 setOption(option: KeyEncoderOption, value: boolean | number): void {
176 const valuePtr = this.exports.ghostty_wasm_alloc_u8();
177 const view = new DataView(this.exports.memory.buffer);
178 view.setUint8(valuePtr, typeof value === 'boolean' ? (value ? 1 : 0) : value);
179 this.exports.ghostty_key_encoder_setopt(this.encoder, option, valuePtr);
180 this.exports.ghostty_wasm_free_u8(valuePtr);
181 }
182
183 setKittyFlags(flags: KittyKeyFlags): void {
184 this.setOption(KeyEncoderOption.KITTY_KEYBOARD_FLAGS, flags);

Callers 2

setKittyFlagsMethod · 0.95
handleKeyDownMethod · 0.80

Calls 3

ghostty_wasm_alloc_u8Method · 0.80
ghostty_wasm_free_u8Method · 0.80

Tested by

no test coverage detected