refactor: update token generation method and improve maxSessions validation

- Changed the token generation method to use slice instead of substr for better readability.
- Enhanced maxSessions validation in the settings update handler to check for undefined values and ensure the input is a number before processing.
This commit is contained in:
SuperComboGamer
2025-12-20 23:20:31 -05:00
parent 39b21830dc
commit 8f5e782583
4 changed files with 12 additions and 4 deletions

View File

@@ -233,7 +233,7 @@ export class TerminalService extends EventEmitter {
return null;
}
const id = `term-${Date.now()}-${Math.random().toString(36).substr(2, 9)}`;
const id = `term-${Date.now()}-${Math.random().toString(36).slice(2, 11)}`;
const { shell: detectedShell, args: shellArgs } = this.detectShell();
const shell = options.shell || detectedShell;