jszczerbinsky / ptsh Goto Github PK
View Code? Open in Web Editor NEWVisually customizable shell utils
License: MIT License
Visually customizable shell utils
License: MIT License
Some OS does not support \e
symbol
After installing on macOS and adding to ZSH path I receive the following error when running ptlsL
/Users/username/.local/bin/ptls: line 91: -1: substring expression < 0
Describe the bug
I ran the install script and received the error at the end of the script output (output below), then I tried to install manually and run into the same error. I have exported the location to the path as instructed.
To Reproduce
Download install script and run.
Expected behavior
Install script to run and tool to run without issues.
Screenshots/terminal output
Cloning into '/tmp/ptSh/v0.2-alpha'...
remote: Enumerating objects: 454, done.
remote: Counting objects: 100% (454/454), done.
remote: Compressing objects: 100% (276/276), done.
remote: Total 454 (delta 276), reused 323 (delta 173), pack-reused 0
Receiving objects: 100% (454/454), 102.56 KiB | 1.14 MiB/s, done.
Resolving deltas: 100% (276/276), done.
HEAD is now at 02d3d7a Merge pull request #21 from 18fadly-anthony/main
Installing...
Version: v0.2-alpha
./install.sh: line 15: ptsh: command not found
Desktop
Is your feature request related to a problem? Please describe.
Mac users are used to installing things using homebrew.
Describe the solution you'd like
Installation like this:
brew install ptsh
Describe alternatives you've considered
I can build the project using make, but I would not normally do that, I want scripted installations, so that they are easy to reproduce on new machines.
Additional context
macOS Monterey
Describe the bug
ptls almostAll option makes some directories ungrouped
To Reproduce
ptls -lA
Desktop
Workaround
// src/ptls/main.c
...
if(dirContent->fileCount >1)
{
// adding this code seems to fix the issue
if (args->almostAll)
dirCount += 2;
if(args->noDirsTop)
sort(dirContent->files, args, 0, dirContent->fileCount-1);
else
{
groupDirs(dirContent, dirCount);
sort(dirContent->files, args, 0, dirCount-1);
sort(dirContent->files, args, dirCount, dirContent->fileCount-1);
}
}
...
Describe the bug
When I copy a file with ptcp the copy has the first letter of the original name cut off, so if for example I copy the file "hello" in another folder, the copy will be called "ello".
To Reproduce
ptcp a file into another directory.
Expected behavior
The copy should have the proper name.
Desktop
Looking at the makefile, there doesn't seem to be anything to figure out what kind of system it will be compiled on.
Somethings compile with warnings and others error from the linux headers in the main.c code.
Downloading a fresh repo copy and running make give the following error:
mkdir -p build
rm -rf build/*
mkdir -p build/bin
mkdir -p build/share
mkdir -p build/share/ptSh
gcc src/common/*.c src/ptls/*.c -lm -o build/bin/ptls
src/ptls/fields.c:46:32: warning: format specifies type 'int' but the argument has type '__darwin_ino64_t' (aka 'unsigned long long') [-Wformat]
sprintf(fields->inode, "%d", file->stats->st_ino);
~~ ^~~~~~~~~~~~~~~~~~~
%llu
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/secure/_stdio.h:47:56: note: expanded from macro 'sprintf'
__builtin___sprintf_chk (str, 0, __darwin_obsz(str), __VA_ARGS__)
^~~~~~~~~~~
1 warning generated.
gcc src/common/*.c src/ptpwd/*.c -lm -o build/bin/ptpwd
src/ptpwd/main.c:1:10: fatal error: 'linux/limits.h' file not found
#include <linux/limits.h>
^~~~~~~~~~~~~~~~
1 error generated.
make: *** [all] Error 1
System Info
gcc --version
Apple clang version 13.1.6 (clang-1316.0.21.2)
Target: x86_64-apple-darwin21.4.0
Thread model: posix
InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin
uname -a
Darwin genes-iMac-Pro.local 21.4.0 Darwin Kernel Version 21.4.0: Mon Feb 21 20:34:37 PST 2022; root:xnu-8020.101.4~2/RELEASE_X86_64 x86_64
Just a suggestion for ptls: make it so that ptls can take directories in arguments. Currently, in order to display the contents of a directory with ptls, you need to be in the directory. However, with ls, you can give directories as arguments, like:
ls ~/Documents
Thus you don't need to be in a specific directory to display the contents of it. This feature would be very nice to have in ptls!
Describe the bug
I can't use ptls with a path as the first argument like ls...
To Reproduce
Run ptls with a folder at ~/test created:
ptls ~/test
Expected behavior
It shows the files in ~/test
instead of the current working directory.
Here it shows the files from the cwd, ~/my-config
Desktop
Describe the bug
When running ptls I receive this error
$HOME/.local/bin/ptls: line 91: -1: substring expression < 0
Also (not sure if related but)
When running pttouch 'foo'
I receive the output
pttouch 'foo'
│ foo
│└readlink: illegal option -- e
│usage: readlink [-n] [file ...]
│ Done
The images are also missing, however that is addressed in another open issue
To Reproduce
run ptls in either bash or zsh
Expected behavior
pretty ptwd
Desktop
MacOS
Shell
GNU bash, version 3.2.57(1)-release (x86_64-apple-darwin20)
zsh 5.8 (x86_64-apple-darwin20.0)
Versions tried:
(commit) 737685c
(tag) v0.2-alpha
Describe the bug
The ptpwd
command outputs a very large number of lines.
To Reproduce
ptpwd
Expected behavior
Printing current working directory
Screenshots/terminal output
A very large number of lines, mostly empty, some of them contains strange L-like characters:
└
Desktop
Hi
No bug here, but I wanted to know which colorscheme you used in your screenshots
Thanks
Describe the bug
when a ptsh command results in an error, the error message is prepended with a space
To Reproduce
run a ptsh command that you know will result in error, optionally compare the terminal output to a ptsh command that results in success
Expected behavior
the error message does not have a space prepended to it, making it consistent with the success output.
Desktop
Is is possible to set an alternative font for the prefix characters from within the config without having to change my terminal font to something that supports displaying these characters?
Describe the bug
When I try to make install
on macOS it fails
To Reproduce
make install
Expected behavior
A working installation.
If macOS is not supported, that should be documented.
Actual behavior
❯ make install
git rev-parse --short HEAD > /tmp/ptsh_ver
mkdir -p ~/.local/share/ptSh
mkdir -p ~/.local/bin
mkdir -p build
gcc src/common/*.c src/ptls/*.c -lm -o build/ptls
src/ptls/fields.c:46:32: warning: format specifies type 'int' but the argument has type '__darwin_ino64_t' (aka 'unsigned long long') [-Wformat]
sprintf(fields->inode, "%d", file->stats->st_ino);
~~ ^~~~~~~~~~~~~~~~~~~
%llu
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/secure/_stdio.h:47:56: note: expanded from macro 'sprintf'
__builtin___sprintf_chk (str, 0, __darwin_obsz(str), __VA_ARGS__)
^~~~~~~~~~~
src/ptls/fields.c:76:3: error: unknown type name '__mode_t'; did you mean 'mode_t'?
__mode_t mode = file->stats->st_mode;
^~~~~~~~
mode_t
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_mode_t.h:31:33: note: 'mode_t' declared here
typedef __darwin_mode_t mode_t;
^
1 warning and 1 error generated.
src/ptls/files.c:4:10: fatal error: 'linux/limits.h' file not found
#include <linux/limits.h>
^~~~~~~~~~~~~~~~
1 error generated.
make: *** [install] Error 1
Desktop
❯ gcc --version
Apple clang version 13.1.6 (clang-1316.0.21.2)
Target: arm64-apple-darwin21.4.0
Thread model: posix
InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin
❯ make --version
GNU Make 3.81
Copyright (C) 2006 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.
There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A
PARTICULAR PURPOSE.
This program built for i386-apple-darwin11.3.0
I like your PS1: https://github.com/jszczerbinsky/ptSh/blob/main/img/ptls.png
anyway I can get it?
I would love for you to add cp
& mv
and rm
to the options.
Specifically, it would be nice to have a progress bar for large file transfers with these options, much like in advcpmv
Does this require you to disable SIP? I cloned the repository, and when I ran make
:
sudo mkdir -p /usr/share/ptSh mkdir: /usr/share/ptSh: Operation not permitted make: *** [install] Error 1
Upon Googling, it looks like this should maybe install to usr/local/
instead of usr/share
? Not sure.
Describe the bug
When using the 'ls' command with 'source ptSh_set_aliases' in ~/.zshrc (for zsh shell), it lists the contents of the home ~/ directory rather than the contents of the directory specified.
To Reproduce
ls [path/to/directory]
Expected behavior
The contents of the directory should be listed out, rather than the contents of the home directory.
With 'source ptSh_set_aliases' removed from the ~/.zshrc, here is the result.
Desktop
OS: Arch Linux
Describe the bug
After installing on macos and following macos specific install instrucions (installing bash and coreutils and updating PATH in .zshrc) all other aliases work fine except for ptwd. When ptwd alias is included in .zshrc the terminal doesn't load propperly.
To Reproduce
Follow install steps in wiki and add alias pwd="~/.local/bin/ptpwd"
to .zshrc
Expected behavior
pretty ptwd
Desktop
MacOS
(loving ptSh thank you for sharing this!)
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.