Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Nov 13, 2025

Transforms NShell from a basic shell into a feature-complete terminal with modern conveniences. Adds essential interactive features and advanced command execution capabilities.

New Built-in Commands (15 total)

  • Navigation/Info: pwd, which, about
  • Output: echo (with variable expansion), clear
  • Shell Control: exit (saves history), help (shows all commands)
  • Environment: export, unset, printenv
  • Aliases: alias, unalias (persisted to ~/.nshell/nshellrc.json)
  • History: history [n] command

Interactive Features

  • Tab completion: Commands and file paths with multi-match display
  • Ctrl+R: Reverse history search with interactive UI
  • Ctrl+Left/Right: Word-based cursor navigation
  • Command suggestions: Levenshtein distance-based "did you mean?" for typos

Advanced Command Execution

  • Chaining: && (conditional), || (fallback), ; (sequential)
  • Redirection: > (overwrite), >> (append)
  • Piping: Basic | support between commands
  • Alias expansion: Automatic substitution with persistence

Implementation Notes

  • ConfigManager handles JSON persistence for aliases
  • Enhanced KeyHandler with sophisticated binding system and tab completion logic
  • CommandParser refactored with recursive execution for chaining, quote-aware splitting
  • Levenshtein distance algorithm for smart command suggestions
  • --no-banner flag for fast startup

Example usage:

# Persistent aliases
alias ll='ls -la'
ll

# Command chaining with redirection
echo "Building..." && dotnet build > build.log || echo "Failed!"

# History search
<Ctrl+R> # Interactive search

# Variable expansion
export MY_VAR="Hello"
echo {MY_VAR}

Stats: 24 files changed, 1,353 additions. Zero security issues (CodeQL verified). Zero build warnings.

Original prompt

Identify and suggest improvements, optimization, new features (original but useful ones to collect interest and stars on the project).


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Copilot AI and others added 4 commits November 13, 2025 13:50
…s, history search

Co-authored-by: onihilist <107046146+onihilist@users.noreply.github.com>
Co-authored-by: onihilist <107046146+onihilist@users.noreply.github.com>
Co-authored-by: onihilist <107046146+onihilist@users.noreply.github.com>
Co-authored-by: onihilist <107046146+onihilist@users.noreply.github.com>
Copilot AI changed the title [WIP] Identify and suggest improvements and optimizations Add production-ready shell features: tab completion, aliases, history search, chaining, and redirection Nov 13, 2025
Copilot AI requested a review from onihilist November 13, 2025 14:04
Copilot finished work on behalf of onihilist November 13, 2025 14:04
@onihilist onihilist marked this pull request as ready for review November 14, 2025 16:08
@onihilist
Copy link
Owner

I just finished the fix on the PluginLoader, now you can add you own plugins !

@onihilist onihilist merged commit e55bbd9 into main Nov 14, 2025
1 check passed
@onihilist onihilist deleted the copilot/suggest-improvements-and-features branch November 19, 2025 12:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants