Update example.js to add multiple terminal inputs and extend timeout duration. Modify stat-vit-term.js to adjust shell arguments for improved compatibility.
This commit is contained in:
@@ -26,11 +26,16 @@ termSession.on('ready', () => {
|
|||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
console.log('\n--- Ping abbrechen mit ^C ---');
|
console.log('\n--- Ping abbrechen mit ^C ---');
|
||||||
termSession.input('^C');
|
termSession.input('^C');
|
||||||
|
|
||||||
|
termSession.input("sdfsdfsdaf\n");
|
||||||
|
termSession.input("\n");
|
||||||
|
termSession.input("\n");
|
||||||
|
termSession.input("\n");
|
||||||
}, 3000);
|
}, 3000);
|
||||||
|
|
||||||
// Nach 4 Sekunden beenden
|
// Nach 4 Sekunden beenden
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
console.log('\n--- Terminal beenden ---');
|
console.log('\n--- Terminal beenden ---');
|
||||||
termSession.kill();
|
termSession.kill();
|
||||||
}, 4000);
|
}, 40000000);
|
||||||
});
|
});
|
||||||
@@ -24,7 +24,7 @@ class StatVitTerm extends EventEmitter {
|
|||||||
_init() {
|
_init() {
|
||||||
try {
|
try {
|
||||||
// Wichtige Änderung: Shell im richtigen Modus starten
|
// Wichtige Änderung: Shell im richtigen Modus starten
|
||||||
const args = process.platform === 'win32' ? [] : ['-i', '-l']; // login shell
|
const args = process.platform === 'win32' ? [] : ['-l']; // login shell
|
||||||
this.process = spawn(this.options.shell, args, {
|
this.process = spawn(this.options.shell, args, {
|
||||||
stdio: ['pipe', 'pipe', 'pipe'],
|
stdio: ['pipe', 'pipe', 'pipe'],
|
||||||
cwd: this.options.cwd,
|
cwd: this.options.cwd,
|
||||||
|
|||||||
Reference in New Issue
Block a user