Update example.js to replace 'top' command with 'ping' for improved functionality. Minor formatting adjustment in stat-vit-term.js to enhance code readability.
This commit is contained in:
@@ -18,13 +18,13 @@ termSession.on('close', (code) => {
|
||||
termSession.on('ready', () => {
|
||||
console.log('Terminal ready\n');
|
||||
|
||||
// Top-Befehl starten
|
||||
console.log('--- Starte top ---');
|
||||
termSession.input('top\n');
|
||||
// Ping starten
|
||||
console.log('--- Ping starten ---');
|
||||
termSession.input('ping 127.0.0.1\n');
|
||||
|
||||
// Nach 3 Sekunden abbrechen
|
||||
setTimeout(() => {
|
||||
console.log('\n--- Top abbrechen mit ^C ---');
|
||||
console.log('\n--- Ping abbrechen mit ^C ---');
|
||||
termSession.input('^C');
|
||||
}, 3000);
|
||||
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
import { EventEmitter } from 'events';
|
||||
import { spawn } from 'child_process';
|
||||
|
||||
|
||||
class StatVitTerm extends EventEmitter {
|
||||
constructor(options = {}) {
|
||||
super();
|
||||
|
||||
Reference in New Issue
Block a user