horeah / pycmd Goto Github PK
View Code? Open in Web Editor NEWImproved interactive experience for Windows' cmd.exe
License: GNU Lesser General Public License v3.0
Improved interactive experience for Windows' cmd.exe
License: GNU Lesser General Public License v3.0
C:\U\leonardo.santagada> cd Idon'texist
************************************
PyCmd has encountered a fatal error!
Traceback (most recent call last):
File "PyCmd.py", line 555, in internal_cd
FileNotFoundError: [WinError 2] The system cannot find the file specified: b"Idon'texist"
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "PyCmd.py", line 774, in <module>
File "PyCmd.py", line 526, in main
File "PyCmd.py", line 587, in run_command
File "PyCmd.py", line 558, in internal_cd
AttributeError: 'str' object has no attribute 'decode'
Crash report written to:
C:\Users\leonardo.santagada\AppData\Roaming\PyCmd\crash-20230110_161154.log
Press any key to exit...
************************************
Is it possible to inject pycmd into a cmd instance when it is called like clink?
Thanks in advance.
In order to allow for a longer directory history PyCmd should use an interactive, searchable Window (similar to the one used for zsh-style completions) when Alt-D is pressed.
In the selection window (e.g. when listing completions), accept Ctrl-P/N/F/B as an alternative to Up/Down/Right/Left and Ctrl-V/Alt-V as an alternative do PgDn/PgUp.
In addition: "entering" the interactive window after pressing Tab is now performed using the "Down" key; Ctrl-N should be accepted as an alternative.
Note: implementation-wise, I would go for a match-case statement. This might be a nice preview/proof-of-concept for using a match-case in the main key-dispatching loop in PyCmd.py (currently kind of messy)
Hi,
Has prompt-toolkit been considered? It would give most of fish shell features missing, vim keybindings and more. The downside is moving token parsing and other infrastructure code to it.
I can give it a try next weekend if this an interesting path.
Every time I start this application, this was printed in the screen:
Access is denied.
Access is denied.
Access is denied.
Welcome to PyCmd 20240206-x64!
F:\Downloads\PC-20240206-w64\PyCmd>
The message "Access is denied." is also printed 3 times after every command that I run inside PyCmd!
App Version: 20240206
OS Version: Windows 10 x64
Thanks.
Hi,
Thanks so much for porting PyCMD to python 3 and moving to github!
I've tried the latest release here and while most seem to work it seems like Ctrl+R is not bind to search, and Shift + F3 also doesn't seem to work. Together with ctrl + a and ctrl + e and general up and down for history, history search on ctrl+r is my most used keybinding on bash. Is there a reason for it not being set?
Dear sir,
When I try "PyCmd 20230424-x64", running adb shell "getprop|grep -iE 'build.type|root.support'"
leads to the system cannot find the path specified
, is it a bug?
"PyCmd 20210310-x64" handle this cmd correctly
As an experiment, PyCmd can now also run on Linux (or WSL) as a front-end for bash; this issue is for collecting and tracking related feedback.
Rationale: while shells focused on user interaction do exist in the Linux world (e.g. fish, and also zsh in some regards) and they are way more advanced than PyCmd, there are still a few areas that PyCmd/Linux covers better (at least in my opinion):
There are a lot of things that are currently not working or need to be improved, of course; the most important ones are listed here:
One can try it out using release bundle "20230424-linux64", or by checking out branch "mesh" -- note that I consider this a "private" branch for now and might be still amending/rebasing; if someone wants to contribute, some prior coordination will be needed.
When pressing Down on the last row, jump to the first entry of the next column (if not already on last column). Similarly, Up on the first row should jump to the previous column.
Sometimes it is desirable to delete some earlier command from the history (e.g. it might contain sensitive information, or maybe it's just plain wrong and we don't want it to "pollute" the history).
This action could be triggered by some key combination (Ctrl-Shift-K?) while navigating the history (either via the current paradigm "type filter string, then Up" or possibly during incremental search as proposed by #1).
Implementing this is complicated because it requires cooperation between multiple running PyCmd instances: deleting from the current instance is not enough, as the other instances will still have it and save it in the history file. This is why the only manual workaround is currently to close all PyCmd processes for the current user, then manipulate the %APPDATA%\history file using some editor.
Ideas on how to implement this (ideally: in a simple way) are welcome ๐
I can currently think of two places where we should display an "abbreviated" path by replacing the home directory with ~:
This was initially reported by @santagada in the context of the incremental history search (#1) but applies to several other places in the code: assuming that the number of terminal cells is equal to the number of characters in the printed string is incorrect for certain classes of Unicode characters!
The suggested solution is to use a package like wcwidth (https://pypi.org/project/wcwidth/) whenever terminal sizes and offsets are being computed.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.