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

Method clearSelection

lib/selection-manager.ts:222–239  ·  view source on GitHub ↗

* Clear the selection

()

Source from the content-addressed store, hash-verified

220 * Clear the selection
221 */
222 clearSelection(): void {
223 if (!this.hasSelection()) return;
224
225 // Mark current selection rows as dirty for redraw
226 const coords = this.normalizeSelection();
227 if (coords) {
228 for (let row = coords.startRow; row <= coords.endRow; row++) {
229 this.dirtySelectionRows.add(row);
230 }
231 }
232
233 this.selectionStart = null;
234 this.selectionEnd = null;
235 this.isSelecting = false;
236
237 // Force redraw of previously selected lines to clear the overlay
238 this.requestRender();
239 }
240
241 /**
242 * Select all text in the terminal

Callers 2

deselectMethod · 0.95
attachEventListenersMethod · 0.95

Calls 3

hasSelectionMethod · 0.95
normalizeSelectionMethod · 0.95
requestRenderMethod · 0.95

Tested by

no test coverage detected