mirror of
https://github.com/gravitational/teleport.git
synced 2026-11-03 16:38:35 +08:00
* Add support for `tsh ssh` on Windows This adds Windows session support to tsh, taking advantage of ANSI terminal support and VT emulation added in recent versions Windows 10. On supported Windows versions (Windows 10 1607+), `tsh ssh` should work as expected in `cmd.exe`, PowerShell, and the new Windows Terminal app. * Address a few review comments * Remove significant chunks of unnecessary tncon code. Removes the global buffer, `GetVTSeqFromKeyStroke`, and several ancillary headers and functions that aren't needed for our (current) use-case. Also removes mouse and focus events. * Refactor OS-specific terminal handling This significantly simplifies OS-specific terminal behavior: * Move OS specific terminal code into a new `terminal` package * Remove `session_windows.go` in favor of an OS-independent `session.go`, defer to terminal package for OS specific functionality. * Remove ConPTY since it's not needed. * Always wait for the terminal and ssh session to fully close before quitting. * Refactor tncon; ensure the raw reader can be closed and reopened, remove lots of unnecessary C code. * Revert dependency changes * Use WindowsOS constant. * Fix `tsh play` on Windows This fixes `tsh play` on Windows by using the new `terminal` module to initialize the terminal for raw input in a cross-platform way. Additionally, this simplifies `terminal.New()` since in practice we never want interactive mode at init time, and fixes a broken unit test. * Use correct log library * Fix `tsh play` player controls on Windows This fixes the console player controls on Windows as well as the timestamp writer. * Clean up lints * Add missing license header * Fix broken unit test * Fix cross-compile builds on Linux/Docker We need windows.h, which is not capitalized in the mingw packages (and is case insensitive on Windows). * Address code review feedback - Rename `Terminal.InitInteractive` to `Terminal.InitRaw` - Ensure goroutines terminate on close - Fix outdated godoc comments - Ensure Terminal event subscribers are cleared (and their channels are closed) - Ensure terminal output mode is reset on error in initTerminal - Bubble up errors in Terminal.Close() - Add author notice to tncon.c re: our changes - Add go-ansiterm as a direct dependency - Run `make update-vendor` * Add constants and a small player.go TODO. * Clear linter warning
8 lines
129 B
C
8 lines
129 B
C
#ifndef __TNCON_H
|
|
#define __TNCON_H
|
|
|
|
// NOTE: Exported for use in tncon.go.
|
|
void ReadInputContinuous(HANDLE hQuitEvent);
|
|
|
|
#endif
|