akinomyoga / ble.sh

Bash Line Editor―a line editor written in pure Bash with syntax highlighting, auto suggestions, vim modes, etc. for Bash interactive sessions.
BSD 3-Clause "New" or "Revised" License
2.54k stars 81 forks source link

Compatibility with oh-my-posh? #343

Closed haizaar closed 1 year ago

haizaar commented 1 year ago

ble version: 0.3.4 Bash version: 5.2.15(1)-release (x86_64-pc-linux-gnu)

Good day, I'm trying to use ble.sh with oh-my-posh. When used separately they work fine, but together - oh-my-posh colors got butchered. It doesn't matter whether I load ble.sh before or after oh-my-posh.

Any ideas how to fix it?

Here is how it looks: image

I'm on NixOS 23.05. The terminal is KDE's konsole.

akinomyoga commented 1 year ago

Hello, that is just because ble-0.3 doesn't support 24-bit colors. You need to use the latest version, ble-0.4.

akinomyoga commented 1 year ago

Let me comment on a bit more context. Somehow, blesh in nixpkgs has been downgraded from 0.4 to 0.3 by https://github.com/NixOS/nixpkgs/pull/224617. Then, another PR https://github.com/NixOS/nixpkgs/pull/226852 trying to fix it has been made, but it is left unprocessed for some reason. I don't think nixpkgs is properly functioning. There are so many packages unprocessed and left broken.

haizaar commented 1 year ago

Thanks for elaborating! I'll try to nudge the maintainer to merge it.

akinomyoga commented 1 year ago

Ah, OK. I also wrote a comment there without noticing your comment. Anyway, thank you for leaving a comment there! By the way, I'm afraid that the package maintainer @aiotter doesn't have permission to merge the PR. Maybe we need to ping any maintainer of nixpkgs itself.

haizaar commented 1 year ago

yeap. blesh resides inside bash in the nixpkg tree, so I pinged bash maintainer. Let's see.

haizaar commented 1 year ago

with 0.4.0-devel3 it works fine!! image

While we are waiting for PR to be merged, here is how to pull in the new ble.sh:

  1. Put the following somewhere you can include it from. E.g. /etc/nixos/apps/blesh.nix
    
    { config, pkgs, ... }:

ble.sh 0.4.0-devel3 while we are waiting for the PR:

https://github.com/NixOS/nixpkgs/pull/226852

Here's why: https://github.com/akinomyoga/ble.sh/issues/343

let

bleshPin = import (pkgs.fetchFromGitHub { owner = "r-ryantm"; repo = "nixpkgs"; rev = "4390703db3908660d64a7b708a615a13130d3614"; sha256 = "sha256-jYK3T6M0lz3I1+OYY6Vmzv6FF+8q44ACrIzqD0nD6bc="; }) {};

in { environment.systemPackages = [ bleshPin.blesh ]; }


2. Add it to the import list in your `configuration.nix`

@akinomyoga thank you for your quick help!
haizaar commented 1 year ago

All in all, I managed to find someone to merge the PR. Thanks again for quick response here!

P.S. Have you considered setting up GH sponsorship for this repo? I'd love to buy you a coffee.

akinomyoga commented 1 year ago

Thank you!

P.S. Have you considered setting up GH sponsorship for this repo? I'd love to buy you a coffee.

No, I haven't. Thanks anyway, but I appreciate your thought!