xcambar / purs Goto Github PK
View Code? Open in Web Editor NEWA Pure-inspired prompt in Rust
License: MIT License
A Pure-inspired prompt in Rust
License: MIT License
Just a reminder that this comment by @nkoehring should be given a try:
% cargo outdated -R
Name Project Compat Latest Kind Platform
---- ------- ------ ------ ---- --------
ansi_term 0.9.0 --- 0.11.0 Normal ---
clap 2.26.1 2.33.0 2.33.0 Normal ---
dirs 1.0.5 --- 2.0.0 Normal ---
regex 0.2.2 0.2.11 1.1.6 Normal ---
try_opt 0.1.1 --- 0.2.0 Normal ---
especially for https://github.com/portocodes/tico/blob/master/src/lib.rs#L42
ping @locks
Setup the CI, so I can stop having bad dreams about it.
Get this:
❯ cargo build --release
Compiling libssh2-sys v0.2.6
error: failed to run custom build command for `libssh2-sys v0.2.6`
process didn't exit successfully: `/Users/nikivi/src/clones/purs/target/release/build/libssh2-sys-5f5996146911a8d3/build-script-build` (exit code: 101)
--- stdout
running: "cmake" "/Users/nikivi/.cargo/registry/src/github.com-1ecc6299db9ec823/libssh2-sys-0.2.6/libssh2" "-DCRYPTO_BACKEND=OpenSSL" "-DOPENSSL_INCLUDE_DIR=/usr/local/opt/openssl/include" "-DBUILD_SHARED_LIBS=OFF" "-DENABLE_ZLIB_COMPRESSION=ON" "-DCMAKE_INSTALL_LIBDIR=lib" "-DBUILD_EXAMPLES=OFF" "-DBUILD_TESTING=OFF" "-DCMAKE_INSTALL_PREFIX=/Users/nikivi/src/clones/purs/target/release/build/libssh2-sys-33ec213e1d609559/out" "-DCMAKE_C_FLAGS= -ffunction-sections -fdata-sections -fPIC -m64" "-DCMAKE_C_COMPILER=/usr/bin/cc" "-DCMAKE_CXX_FLAGS= -ffunction-sections -fdata-sections -fPIC -m64" "-DCMAKE_CXX_COMPILER=/usr/bin/c++" "-DCMAKE_BUILD_TYPE=Release"
-- The C compiler identification is AppleClang 10.0.0.10001145
-- Check for working C compiler: /usr/bin/cc
-- Check for working C compiler: /usr/bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Found OpenSSL: /usr/local/opt/openssl/lib/libcrypto.dylib (found version "1.0.2q")
-- Looking for EVP_aes_128_ctr
-- Looking for EVP_aes_128_ctr - found
-- Configuring incomplete, errors occurred!
See also "/Users/nikivi/src/clones/purs/target/release/build/libssh2-sys-33ec213e1d609559/out/build/CMakeFiles/CMakeOutput.log".
--- stderr
fatal: not a git repository (or any of the parent directories): .git
CMake Error at /nix/store/q3njfqg1nicir8gy5s5pqy9rqyyznxfg-cmake-3.12.1/share/cmake-3.12/Modules/FindPackageHandleStandardArgs.cmake:137 (message):
Could NOT find ZLIB (missing: ZLIB_LIBRARY ZLIB_INCLUDE_DIR)
Call Stack (most recent call first):
/nix/store/q3njfqg1nicir8gy5s5pqy9rqyyznxfg-cmake-3.12.1/share/cmake-3.12/Modules/FindPackageHandleStandardArgs.cmake:378 (_FPHSA_FAILURE_MESSAGE)
/nix/store/q3njfqg1nicir8gy5s5pqy9rqyyznxfg-cmake-3.12.1/share/cmake-3.12/Modules/FindZLIB.cmake:112 (FIND_PACKAGE_HANDLE_STANDARD_ARGS)
src/CMakeLists.txt:239 (find_package)
thread 'main' panicked at '
command did not execute successfully, got: exit code: 1
build script failed, must exit now', /Users/nikivi/.cargo/registry/src/github.com-1ecc6299db9ec823/cmake-0.1.25/src/lib.rs:599:5
note: Run with `RUST_BACKTRACE=1` environment variable to display a backtrace.
How to reproduce:
cargo new proj
cd proj
Error:
thread 'main' panicked at 'called `Result::unwrap()` on an `Err` value: Error { code: -9, klass: 4, message: "reference \'refs/heads/master\' not found" }', /checkout/src/libcore/result.rs:906:4
the issue occurs in src/precmd.rs#L34.
btw great idea!! thank you for starting this.
One feature I would love to see is that ">" is only the prompt for localhost. In an SSH session, name and host would be useful to distinguish. The original pure prompt supports this.
Thanks @hiseni for pointing this out to me!
required some env variables to build on OS X with brewed openssl
RUSTFLAGS="-L/usr/local/Cellar/openssl/1.0.2p/lib" OPENSSL_INCLUDE_DIR=/usr/local/Cellar/openssl/1.0.2p/include PKG_CONFIG_PATH=/usr/local/Cellar/openssl/1.0.2p/lib/pkgconfig cargo build --release --verbose
thread 'main' panicked at 'called Result::unwrap()
on an Err
value: Error { code: -9, klass: 4, message: "reference 'refs/heads/master' not found" }', src/libcore/result.rs:906:4
note: Run with RUST_BACKTRACE=1
for a backtrace.
I get this when i create a folder and 'git init' in it without adding or committing the files inside the dir. After i did the git add .
and git commit -am "initial commit"
it works fine again.
I always use ^l
to clear my screen, and the first line (containing the path and git info) doesn't get redrawn, leaving me with just the actual prompt line.
follows #7
On new repos, the dirty marker is not shown before the first commit.
There should be a marker even though the current branch can not be displayed (because it does not exist)
The prompt shows the correct git info only when at the root of the repo.
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.