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(() => {
|
||||
console.log('\n--- Ping abbrechen mit ^C ---');
|
||||
termSession.input('^C');
|
||||
|
||||
termSession.input("sdfsdfsdaf\n");
|
||||
termSession.input("\n");
|
||||
termSession.input("\n");
|
||||
termSession.input("\n");
|
||||
}, 3000);
|
||||
|
||||
// Nach 4 Sekunden beenden
|
||||
setTimeout(() => {
|
||||
console.log('\n--- Terminal beenden ---');
|
||||
termSession.kill();
|
||||
}, 4000);
|
||||
}, 40000000);
|
||||
});
|
||||
@@ -24,7 +24,7 @@ class StatVitTerm extends EventEmitter {
|
||||
_init() {
|
||||
try {
|
||||
// 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, {
|
||||
stdio: ['pipe', 'pipe', 'pipe'],
|
||||
cwd: this.options.cwd,
|
||||
|
||||
Reference in New Issue
Block a user