Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Printed new line is weird #565

Open
mobsenpai opened this issue Apr 23, 2024 · 9 comments
Open

Printed new line is weird #565

mobsenpai opened this issue Apr 23, 2024 · 9 comments

Comments

@mobsenpai
Copy link

mobsenpai commented Apr 23, 2024

After selection an option the new line printed shows like this->

Before select: I pressed ctrl + r it started skim and its normal.
image

After select: I selected cmatrix from list and now cmat is beside my starship prompt.
image

OS: Nixos
Shell: Bash
Prompt: Starship

I don't know what informative to give for this one. As I don't have any skim configuration in my bashrc. I just have a nixos option enabled

skim = {
        enable = true;
        enableBashIntegration = true;
      };
@mobsenpai mobsenpai changed the title [Ctrl + R] in bash weird printing upon selecting an option. Printed new line is weird May 1, 2024
@mobsenpai
Copy link
Author

Looks like the project is abandoned.

@mobsenpai mobsenpai closed this as not planned Won't fix, can't repro, duplicate, stale May 1, 2024
@linuxmobile
Copy link

Looks like the project is abandoned.

Regarding the fact that it is abandoned. As long as it works I have no problem using it. However, I find that there are people who are maintaining a fork. You could try it!

https://github.com/nrdxp/skim/

Regarding the error. In zsh I don't have this problem. I can't tell you why!

@mobsenpai mobsenpai reopened this Nov 30, 2024
@LoricAndre
Copy link
Contributor

There's a good chance that this is due to your starship configuration rather than skim itself, could you please share it ?

@mobsenpai
Copy link
Author

mobsenpai commented Nov 30, 2024

Okay. I am currently not on my pc so can only share my nix dotfiles.
starship.nix

I also use bash instead of zsh and all the configs are in my dotfiles 'hana'

@LoricAndre
Copy link
Contributor

This doesn't really look like the config for the prompt above, could you please share your $PS1 and $PS2 ?
I'm looking for something like a \r somewhere that would justify this

@mobsenpai
Copy link
Author

"This doesn't really look like the config for the prompt above" - If you meant the starship prompt doesn't look like the one shows in the pic, then it was because I've changed the config a little bit.
Here is the starship config

add_newline = false
format = "$username$directory$git_branch$git_metrics$git_commit$git_state$git_status$all"

[aws]
symbol = ""

[buf]
symbol = ""

[c]
symbol = ""

[character]
error_symbol = "[❯](bright-red)"
success_symbol = "[❯](bright-black)"
vimcmd_symbol = "[❯](bright-green)"

[conda]
symbol = ""

[crystal]
symbol = ""

[dart]
symbol = ""

[directory]
read_only = " 󰌾"
style = "bright-blue"

[docker_context]
symbol = ""

[elixir]
symbol = ""

[elm]
symbol = ""

[fennel]
symbol = ""

[fossil_branch]
symbol = ""

[git_branch]
format = "[$symbol$branch(:$remote_branch)]($style) "
style = "bright-black"
symbol = ""

[git_commit]
tag_symbol = ""

[git_metrics]
added_style = "bright-black"
deleted_style = "bright-black"
disabled = false

[git_status]
style = "bright-black"

[golang]
symbol = ""

[gradle]
symbol = ""

[guix_shell]
symbol = ""

[haskell]
symbol = ""

[haxe]
symbol = ""

[hg_branch]
symbol = ""

[hostname]
ssh_symbol = ""

[java]
symbol = ""

[julia]
symbol = ""

[kotlin]
symbol = ""

[lua]
symbol = ""

[memory_usage]
symbol = "󰍛 "

[meson]
symbol = "󰔷 "

[nim]
symbol = "󰆥 "

[nix_shell]
symbol = ""

[nodejs]
symbol = ""

[ocaml]
symbol = ""

[os.symbols]
NixOS = ""

[package]
symbol = "󰏗 "

[perl]
symbol = ""

[php]
symbol = ""

[pijul_channel]
symbol = ""

[python]
symbol = ""

[rlang]
symbol = "󰟔 "

[ruby]
symbol = ""

[rust]
symbol = "󱘗 "

[scala]
symbol = ""

[swift]
symbol = ""

[username]
format = "[$user](purple) "
show_always = true

[zig]
symbol = ""

And I had skim not enabled in nixos in my dots. In my PC I did programs.skim.enable = true. and Enabled skim. Then pressed ctrl + r to bring up the history of commands.
And this is what shows -
image
image
image
image

" share your $PS1 and $PS2" I don't really have anything configured, also I don't know where to find them, nothing was in bashrc as well.

# Commands that should be applied only for interactive shells.
[[ $- == *i* ]] || return

HISTCONTROL=erasedups:ignorespace
HISTFILESIZE=100000
HISTSIZE=10000

shopt -s autocd
shopt -s cdspell
shopt -s cmdhist
shopt -s dotglob
shopt -s histappend
shopt -s expand_aliases

alias cat='bat'
alias eza='eza '\''--icons'\'' '\''--git'\'''
alias grep='rg'
alias l='ll'
alias la='eza -la'
alias laa='la -snew --group-directories-first'
alias ll='eza -l'
alias lll='ll -snew --group-directories-first'
alias ls='eza'
alias neofetch='fastfetch'
alias rm='trash-put'
alias ytmp3='yt-dlp -x --continue --add-metadata --embed-thumbnail --audio-format mp3 --audio-quality 0 --metadata-from-title="%(artist)s - %(title)s" --prefer-ffmpeg -o "%(title)s.%(ext)s"'

if [[ ! -v BASH_COMPLETION_VERSINFO ]]; then
  . "/nix/store/14izq6jjd2l24w2p4j4xmkfkp0521vr0-bash-completion-2.13.0/etc/profile.d/bash_completion.sh"
fi

bind "set completion-ignore-case on"

set -o vi
bind -m vi-command 'Control-l: clear-screen'
bind -m vi-insert 'Control-l: clear-screen'
bind -m vi-insert 'Control-k: previous-history'
bind -m vi-insert 'Control-j: next-history'

if [[ $TERM != "dumb" ]]; then
  eval "$(/etc/profiles/per-user/yashraj/bin/starship init bash --print-full-init)"
fi

if [[ :$SHELLOPTS: =~ :(vi|emacs): ]]; then
  . /nix/store/l9j6wfmxwhvxk1px09sxr69rc60q4i3k-skim-0.10.4/share/skim/completion.bash
  . /nix/store/l9j6wfmxwhvxk1px09sxr69rc60q4i3k-skim-0.10.4/share/skim/key-bindings.bash
fi

@LoricAndre
Copy link
Contributor

Thanks.
Just to be sure, does the issue happen only right after you exit the ctrl-r menu or does it persist after you press enter to get a new prompt line for example ?
Also, skim 0.10.4 is a bit outdated, could you please update ?

@mobsenpai
Copy link
Author

Yeah I press enter and what I wrote before pressing enter stays there instead of yk completely being replaced with the chosen history.
So I only have 0.10.4 version is all of nixos repositories and I would have to make some changes manually in my config to use the latest version

@LoricAndre
Copy link
Contributor

I'm not sure there is much we can do until nix-pkgs updates skim to a later version unfortunately

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants