@gjsify/terminal-native 0.7.5 → 0.8.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gjsify/terminal-native",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.8.0",
|
|
4
4
|
"description": "Optional Vala/GObject bridge providing Posix.isatty(), ioctl(TIOCGWINSZ), termios raw-mode and SIGWINCH for GJS. Enhances @gjsify/tty and @gjsify/process with correct terminal behaviour when installed.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "lib/esm/index.js",
|
|
@@ -56,7 +56,7 @@
|
|
|
56
56
|
"@girs/gobject-2.0": "2.88.0-4.0.4"
|
|
57
57
|
},
|
|
58
58
|
"devDependencies": {
|
|
59
|
-
"@gjsify/cli": "^0.
|
|
59
|
+
"@gjsify/cli": "^0.8.0",
|
|
60
60
|
"@ts-for-gir/cli": "^4.0.4",
|
|
61
61
|
"@types/node": "^25.9.2",
|
|
62
62
|
"typescript": "^6.0.3"
|
|
Binary file
|
package/src/vala/terminal.vala
CHANGED
|
@@ -79,12 +79,17 @@ namespace GjsifyTerminal {
|
|
|
79
79
|
var t = Posix.termios ();
|
|
80
80
|
if (_tcgetattr (fd, ref t) != 0) return false;
|
|
81
81
|
if (enable) {
|
|
82
|
-
|
|
82
|
+
// Node-parity raw mode: also clear ISIG so Ctrl-C / Ctrl-Z
|
|
83
|
+
// arrive as keystrokes (\x03 / \x1a) for the app to handle,
|
|
84
|
+
// not as signals that would kill the process and leave the
|
|
85
|
+
// terminal stuck in raw mode. Matches Node's tty
|
|
86
|
+
// ReadStream.setRawMode(true).
|
|
87
|
+
t.c_lflag &= ~(Posix.ICANON | Posix.ECHO | Posix.ISIG);
|
|
83
88
|
t.c_iflag &= ~Posix.ICRNL;
|
|
84
89
|
t.c_cc[Posix.VMIN] = 1;
|
|
85
90
|
t.c_cc[Posix.VTIME] = 0;
|
|
86
91
|
} else {
|
|
87
|
-
t.c_lflag |= (Posix.ICANON | Posix.ECHO);
|
|
92
|
+
t.c_lflag |= (Posix.ICANON | Posix.ECHO | Posix.ISIG);
|
|
88
93
|
t.c_iflag |= Posix.ICRNL;
|
|
89
94
|
}
|
|
90
95
|
return _tcsetattr (fd, Posix.TCSAFLUSH, ref t) == 0;
|