We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent d436163 commit 2606e76Copy full SHA for 2606e76
cyclops-ui/src/components/pages/Terminal.tsx
@@ -66,6 +66,30 @@ const ExecTerminal = ({
66
t.writeln("[Disconnected]");
67
};
68
69
+ t.attachCustomKeyEventHandler((event) => {
70
+ if (event.key === "ArrowUp") {
71
+ t.write("^[[A");
72
+ inputBuffer.current += "^[[A";
73
+ return false;
74
+ }
75
+ if (event.key === "ArrowDown") {
76
+ t.write("^[[B");
77
+ inputBuffer.current += "^[[B";
78
79
80
+ if (event.key === "ArrowRight") {
81
+ t.write("^[[C");
82
+ inputBuffer.current += "^[[C";
83
84
85
+ if (event.key === "ArrowLeft") {
86
+ t.write("^[[D");
87
+ inputBuffer.current += "^[[D";
88
89
90
+ return true;
91
+ });
92
+
93
t.onData((data) => {
94
const charCode = data.charCodeAt(0);
95
0 commit comments