@openxiaobu/codexl 0.1.11 → 0.1.12
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/dist/cli.js +8 -9
- package/package.json +1 -1
package/dist/cli.js
CHANGED
|
@@ -105,6 +105,7 @@ async function handleInteractiveToggle() {
|
|
|
105
105
|
}
|
|
106
106
|
}
|
|
107
107
|
(0, config_1.saveConfig)(latest);
|
|
108
|
+
changed = false;
|
|
108
109
|
};
|
|
109
110
|
render();
|
|
110
111
|
const onKeypress = (_str, key) => {
|
|
@@ -121,28 +122,26 @@ async function handleInteractiveToggle() {
|
|
|
121
122
|
if (key.name === "space") {
|
|
122
123
|
accounts[cursor].enabled = !accounts[cursor].enabled;
|
|
123
124
|
changed = true;
|
|
125
|
+
applyChanges();
|
|
124
126
|
render();
|
|
125
127
|
return;
|
|
126
128
|
}
|
|
127
129
|
if (key.name === "return" || key.name === "enter") {
|
|
128
130
|
if (changed) {
|
|
129
131
|
applyChanges();
|
|
130
|
-
changed = false;
|
|
131
|
-
render();
|
|
132
|
-
console.log("\n已保存账号启用状态变更(按 q 退出)。");
|
|
133
132
|
}
|
|
133
|
+
stdin.off("keypress", onKeypress);
|
|
134
|
+
stdin.setRawMode?.(false);
|
|
135
|
+
console.log("\n已退出账号启用状态编辑。");
|
|
134
136
|
return;
|
|
135
137
|
}
|
|
136
138
|
if (key.name === "q" || (key.ctrl && key.name === "c")) {
|
|
137
|
-
stdin.off("keypress", onKeypress);
|
|
138
|
-
stdin.setRawMode?.(false);
|
|
139
139
|
if (changed) {
|
|
140
140
|
applyChanges();
|
|
141
|
-
console.log("\n已保存账号启用状态变更。");
|
|
142
|
-
}
|
|
143
|
-
else {
|
|
144
|
-
console.log("\n未做任何变更。");
|
|
145
141
|
}
|
|
142
|
+
stdin.off("keypress", onKeypress);
|
|
143
|
+
stdin.setRawMode?.(false);
|
|
144
|
+
console.log("\n已退出账号启用状态编辑。");
|
|
146
145
|
return;
|
|
147
146
|
}
|
|
148
147
|
};
|