Server to aid shell navigation.
Project description
ShellServer
It's a mix of Starship and Zoxide but faster.
On Starship, every 'Enter' keystroke spawns a new process, which may cause a lag between prompts.
Zoxide will raise a new process every time you call it.
ShellServer raises the server only in the first shell creation and will communicate with your shell on every 'Enter' keystroke.
Fastness comes from not having spawning time, which seems to be way higher in Windows.
But if your hardware gives you a fluid shell experience using Starship, I recommend that you keep with it because it's way more customizable.
Features
Prompt with a fast glance at what is in directory
This is the most bloated prompt that you will get.
It will indicate the existence of Python, C, C++, Lua, Node and PowerShell files on directory.
The compilers searched are GCC and G++.
No lag from spawning processes
Better 'cd'
p -o path
for writing to output. Tool for things likemove somefile (p -o somepath)
p
behaves likecd
for unknown paths
Note: fzf is a dependency to use 'pz'
Switching Theme
Can take four arguments: all, system, terminal, and blue.
- terminal: Toggles Windows Terminal default theme.
- system: Toggles system wide Dark Mode.
- blue: Toggles 'Blue light reduction'.
- all: Same as not passing arguments. Do all the above.
The system
option is not working properly on Windows 11 22h2...
Searching history
Listing directory
Customization
The server will look for a .shellserver.toml
in the user home directory.
Only two options will be searched right now.
# Windows Terminal themes
dark_theme = '...' # defaults to Tango Dark
light_theme = '...' # Solarized Light
CLI
The server knows how many clients it haves and will know if you quit shell with 'exit'
but if window is closed on 'X' it may outlive the shell.
usage: shellserver [-h] {kill,clear}
positional arguments:
{kill,clear} "kill" to kill the server, "clear" to clear the cache.
options:
-h, --help show this help message and exit
Requirements
- Python 3.9+ or latest Pypy (still slower than Python 3.11)
- PowerShell 6.2+ (I think)
- Any NerdFont (I use MesloGS NF)
- A xterm compatible terminal
Installation
Currently, ShellServer will work only in PowerShell on Windows.
> pip install shellserver # or pip install --user shellserver
> Install-Module ShellServer -Scope CurrentUser
In your PowerShell profile:
# By the beginning of the file
pythonw -m shellserver # note the 'w'
# By the end of the file
Import-Module ShellServer
Keep updated
As many things might change in versions below 0.1.0, pip install --upgrade shellserver
and Upgrade-Module ShellServer
must be run both when one changes.
v0.0.8+ will work with the PowerShell ShellServer module 0.0.6+.
Debugging
The git status info still experimental, do pythonw -m shellserver --use-git
in your profile to always use git.
Any errors that occur will be saved in $env:localappdata\shellserver\traceback
.
Attach a stdout to the server, pass --verbose
to it and it will give the time taken for each communication.
--verbose --git-verbose
will give lot of info when it sees a git repo.
> shellserver kill
# A message that the server is not responding and your prompt will be like before.
> python -m shellserver --verbose --git-verbose # no w, blocking
Open another shell and walk to a git repo.
The server can accept --let-crash
argument to let errors propagate. --use-git
will have preference over this.
There are also:
--disable-git
--wait
: We will use our 'gitstatus' subpackage for repos up to 2500 index entries. Will use git otherwise, unless this flag is set.
On Pwsh module:
Set-ServerTimeout
: arg in ms.Set-ServerOpt
: Set options in runtime:- enable-git
- disable-git
- use-git: Use git.exe for git status info
- wait: Use 'gitstatus' subpackage no matter how big is repo
- verbose
- let-crash: At this point it's probably useless
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file shellserver-0.0.11.tar.gz
.
File metadata
- Download URL: shellserver-0.0.11.tar.gz
- Upload date:
- Size: 22.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.11.2
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 737bc664f83b3f8afc6d99c46c1ff05f1d84ea53e5019b9ecdbbb665d70b17c9 |
|
MD5 | 28fbbc960a325a2e9b4702b2efc1744f |
|
BLAKE2b-256 | b585b11f14ef8200dcc9649d92b44c805a04252f77667b60f7f3066c90193fdd |
File details
Details for the file shellserver-0.0.11-py3-none-any.whl
.
File metadata
- Download URL: shellserver-0.0.11-py3-none-any.whl
- Upload date:
- Size: 23.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.11.2
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | ed55867891878b3c40e57c8b3267e2c1d6c7c6ebab8c57031c9a2e715b786b86 |
|
MD5 | 53162d9539411ca3acceef28d539e113 |
|
BLAKE2b-256 | e56a90d679f1c5509369a90db0725e3a78c523ec791a87ce8ead7301d3db8109 |