-
-
Notifications
You must be signed in to change notification settings - Fork 765
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
Browser integration fails if you run cmd before picking a file (kitty, konsole, wezterm) #2003
Comments
I just tried
#!/bin/sh
while :; do case $1 in
--getsavefilename) file="$2" break ;;
--version) printf ""; exit ;;
--*) shift ;;
*) break ;;
esac done
file="${file##/*/}"
kitty --class picker sh -c "nnn -JRHdaA -Tt -p - '$file' | awk '{ print system(\"[ -d '\''\"\$0\"'\'' ]\") ? \$0 : \$0\"/$file\" }' > /proc/$$/fd/1"
|
What happens if you run this command from a terminal kitty --class picker sh -c "nnn -JRHdaA -Tt -p - '$file' | awk '{ print system(\"[ -d '\''\"\$0\"'\'' ]\") ? \$0 : \$0\"/$file\" }' > /proc/$$/fd/1" Is kitty printing something? The file dialogue thing requires the selected file to be printed to stdout so if kitty is printing it's own stuff then that could be the reason why. |
# In this dialog I used Ctrl+] (to enter shell) before pressing enter on a file
[serranomorante@arch playbooks]$ kitty --class picker sh -c "nnn -JRHdaA -Tt -p - '$file' | awk '{ print system(\"[ -d '\''\"\$0\"'\'' ]\") ? \$0 : \$0\"/$file\" }' > /proc/$$/fd/1"
[0.215] [glfw error 65544]: process_desktop_settings: failed with error: [org.freedesktop.DBus.Error.ServiceUnknown] The name is not activatable
/home/serranomorante/dotfiles/playbooks/ansible.cfg
# On this one I pressed enter on the file (without entering the shell)
[serranomorante@arch playbooks]$ kitty --class picker sh -c "nnn -JRHdaA -Tt -p - '$file' | awk '{ print system(\"[ -d '\''\"\$0\"'\'' ]\") ? \$0 : \$0\"/$file\" }' > /proc/$$/fd/1"
[0.231] [glfw error 65544]: process_desktop_settings: failed with error: [org.freedesktop.DBus.Error.ServiceUnknown] The name is not activatable
/home/serranomorante/dotfiles/playbooks/ansible.cfg
The thing is, the second option still works (the browser is able to open the file normally). |
nnn -JRHdaA -Tt -p - '$file' ...
nnn
master: yesExact steps to reproduce the issue
I believe you don't need all my config and nnn plugins to be able to replicate this. These are the steps:
Control+o
to "open a file". This should open the nnn picker.Control+]
to open the shell. You don't have to execute anything in here, just writeexit
The browser will try to open a non existent file. This doesn't happen if you don't enter the cmd mode with
Control+]
first.The reason I need to enter the cmd mode before picking a file is to perform a
cd <path>
manually to find the file (because I might have copy the absolute path from other app).These are the terminal emulators that present the issue when you use them in the
kdialog
script.The text was updated successfully, but these errors were encountered: