Git Product home page Git Product logo

ptsh's Issues

ptls error on macos

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

[BUG] Receiving ptSh does not exist

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

  • Arch Linux Arm
  • ZSH Shell (also tried on Bash, same error)

[FEATURE PROPOSAL] homebrew instegration

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

[BUG] ptls almostAll option makes some directories ungrouped

Describe the bug
ptls almostAll option makes some directories ungrouped

To Reproduce
ptls -lA

Expected behavior
image

Screenshots/terminal output
image

Desktop

  • Windows11/WSL2(Void linux)

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);
    }
  }
  ...

[BUG] ptcp cuts off first letter of file name

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.

Screenshots/terminal output
image

Desktop

  • OS/Linux distro: Arch Linux

ptpwd doesn't compile on MacOS Monterey 12.3[BUG]

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

Feature suggestion for ptls

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!

[BUG] ptls doesn't seem to use the path as an argument

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.

Screenshots/terminal output
image

Here it shows the files from the cwd, ~/my-config

Desktop

  • OS/Linux distro: [e.g. MacOS, ArchLinux, Debian]
    I am running Manjaro.

ptsh error on macos

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

[BUG] ptpwd outputs weirdly many lines

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

  • OS/Linux distro: macOS Monterey 12.3

[BUG] added space in error messages

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.

Screenshots/terminal output
image

Desktop

  • OS/Linux distro: linux mint

set alternative font for Prefix chars

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?

[BUG] Does not compile on macOS `'linux/limits.h' file not found`

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

  • OS/Linux distro: macOS Monterey 12.3. Hardware is Apple Silicon.
❯ 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

[Feature proposal] Add cp + mv + rm

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

Disable SIP?

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.

[BUG] ls with specified path only shows contents of ~/

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.

Screenshots/terminal output
2021-10-27_21-09

With 'source ptSh_set_aliases' removed from the ~/.zshrc, here is the result.

2021-10-27_21-13

Desktop
OS: Arch Linux

ptwd error on macos [BUG]

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

Screenshots/terminal output
Screen Shot 2021-05-14 at 10 42 31 AM

Screen Shot 2021-05-14 at 10 40 20 AM

Desktop
MacOS

(loving ptSh thank you for sharing this!)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.