icoa-cli 1.3.2 → 1.3.3

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/index.js CHANGED
@@ -13,6 +13,7 @@ import { registerLangCommand } from './commands/lang.js';
13
13
  import { registerSetupCommand } from './commands/setup.js';
14
14
  import { getConfig, saveConfig } from './lib/config.js';
15
15
  import { startRepl } from './repl.js';
16
+ import { checkTerminal } from './lib/terminal.js';
16
17
  // Banner: each line between ║ ║ = exactly 58 visible chars
17
18
  const B = chalk.cyan('║');
18
19
  const BANNER = `
@@ -35,7 +36,7 @@ ${B} ${B}
35
36
  ${B} ${chalk.white('Sydney, Australia')} ${chalk.gray('Jun 27 - Jul 2, 2026')} ${B}
36
37
  ${B} ${chalk.cyan.underline('https://icoa2026.au')} ${B}
37
38
  ${B} ${B}
38
- ${B} ${chalk.gray('CLI-Native Competition Terminal v1.3.2')} ${B}
39
+ ${B} ${chalk.gray('CLI-Native Competition Terminal v1.3.3')} ${B}
39
40
  ${B} ${B}
40
41
  ${chalk.cyan('╚══════════════════════════════════════════════════════════╝')}
41
42
  `;
@@ -61,6 +62,7 @@ program
61
62
  .option('--resume', 'Resume previous session')
62
63
  .action((opts) => {
63
64
  console.log(BANNER);
65
+ checkTerminal();
64
66
  // If running interactively (no extra args or --resume), start REPL
65
67
  if (process.argv.length <= 2 || opts.resume) {
66
68
  startRepl(program, !!opts.resume);
@@ -0,0 +1,7 @@
1
+ interface TerminalInfo {
2
+ name: string;
3
+ allowed: boolean;
4
+ }
5
+ export declare function detectTerminal(): TerminalInfo;
6
+ export declare function checkTerminal(): void;
7
+ export {};
@@ -0,0 +1,45 @@
1
+ import chalk from 'chalk';
2
+ export function detectTerminal() {
3
+ const termProgram = process.env.TERM_PROGRAM || '';
4
+ const platform = process.platform;
5
+ // macOS: only Apple Terminal
6
+ if (platform === 'darwin') {
7
+ if (termProgram === 'Apple_Terminal') {
8
+ return { name: 'macOS Terminal', allowed: true };
9
+ }
10
+ return { name: termProgram || 'Unknown macOS terminal', allowed: false };
11
+ }
12
+ // Linux: GNOME Terminal, or basic xterm/linux console
13
+ if (platform === 'linux') {
14
+ const isGnome = termProgram === 'gnome-terminal' ||
15
+ process.env.GNOME_TERMINAL_SERVICE !== undefined;
16
+ if (isGnome) {
17
+ return { name: 'GNOME Terminal', allowed: true };
18
+ }
19
+ // Also allow basic linux console (no TERM_PROGRAM, e.g. TTY)
20
+ if (!termProgram && (process.env.TERM === 'linux' || process.env.TERM === 'xterm')) {
21
+ return { name: 'Linux Console', allowed: true };
22
+ }
23
+ return { name: termProgram || 'Unknown Linux terminal', allowed: false };
24
+ }
25
+ // Windows: PowerShell
26
+ if (platform === 'win32') {
27
+ const isPowerShell = !!process.env.PSModulePath;
28
+ if (isPowerShell) {
29
+ return { name: 'PowerShell', allowed: true };
30
+ }
31
+ return { name: 'Windows CMD or other', allowed: false };
32
+ }
33
+ return { name: 'Unknown', allowed: false };
34
+ }
35
+ export function checkTerminal() {
36
+ const info = detectTerminal();
37
+ if (!info.allowed) {
38
+ console.log(chalk.yellow(` ⚠ Unsupported terminal: ${info.name}`));
39
+ console.log(chalk.gray(' Competition requires:'));
40
+ console.log(chalk.gray(' macOS → Terminal.app (system default)'));
41
+ console.log(chalk.gray(' Linux → GNOME Terminal (system default)'));
42
+ console.log(chalk.gray(' Windows → PowerShell (system default)'));
43
+ console.log();
44
+ }
45
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "icoa-cli",
3
- "version": "1.3.2",
3
+ "version": "1.3.3",
4
4
  "description": "ICOA CLI — The world's first CLI-native CTF competition terminal",
5
5
  "type": "module",
6
6
  "bin": {