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

Bad stdin for text editors like neovim and nano. #34

Closed
freed00m opened this issue Mar 29, 2021 · 11 comments
Closed

Bad stdin for text editors like neovim and nano. #34

freed00m opened this issue Mar 29, 2021 · 11 comments

Comments

@freed00m
Copy link

freed00m commented Mar 29, 2021

Before dismissing this, with xdg-utils Arch package, the following terminal *.desktop entriy works as expected.

at ~/.local/share/applications/nvim.desktop

[Desktop Entry]
Type=Application
Name=Neovim editor
cat mimeapps.list | grep nvim
application/octet-stream=nvim.desktop;
text/plain=nvim.desktop;
text/markdown=nvim.desktop;
application/x-shellscript=nvim.desktop;
Exec=nvim %F
Terminal=true
NoDisplay=true
Type=Application
Icon=nvim
Categories=Utility;TextEditor

the following

% handlr open simple.txt fails to launch nvim. (nvim is running in the background)

The nvim.desktop entry is matched correctly and used.

cat mimeapps.list | grep nvim
application/octet-stream=nvim.desktop;
text/plain=nvim.desktop;
text/markdown=nvim.desktop;
application/x-shellscript=nvim.desktop;

I am able to launch nvim in separate terminal window

if I change exec

Exec=alacritty -e nvim %F

Then it works and spawns new window with nvim opening the file.

@freed00m
Copy link
Author

Every terminal interactive app gets send into the background, that's very unuseable.

@Dioprz
Copy link

Dioprz commented Apr 1, 2021

I have exactly the same problem with nvim and the 'handlr-bin' package from AUR. Is there any other solution to modifying the .desktop file?

@freed00m
Copy link
Author

freed00m commented Apr 1, 2021

@chmln - I've noticed your comment + commit #28 (comment)

Is this change related? The multiple file detecting happens for all %F and %U detected even though use might want to open a single file and spawnit directly it being send into background.

"I wish I was a Rust programmer", looking at the source and fixing it might take lot of time for me.

@Wisehh - I am not sure, currently i would say no, but maybe there is a way how to TRAP the signal that sends it to background.

chmln added a commit that referenced this issue Apr 23, 2021
@chmln
Copy link
Owner

chmln commented Apr 23, 2021

@freed00m @Wisehh Thanks for reporting this issue, this is fixed in the latest release.
Feel free to re-open if you run into any issues

@chmln chmln closed this as completed Apr 23, 2021
@ghost
Copy link

ghost commented Apr 24, 2021

I am still having this error..
Using the handlr-bin from AUR.

I have ~/local/share/applications/ranger.desktop with:

[Desktop Entry]
Name=ranger
Type=Application
Terminal=true
Exec=ranger %F
MimeType=inode/directory;

And in ~/.config/mimeapps.list:

[Default Applications]
inode/directory=ranger.desktop;

Launching from dmenu works as expected, but from alacritty i get the following:

% handlr open .

Traceback (most recent call last):
  File "/usr/bin/ranger", line 37, in <module>
    sys.exit(ranger.main())  # pylint: disable=no-member
  File "/usr/lib/python3.9/site-packages/ranger/core/main.py", line 231, in main
    fm.ui.destroy()
  File "/usr/lib/python3.9/site-packages/ranger/gui/ui.py", line 178, in destroy
    self.suspend()
  File "/usr/lib/python3.9/site-packages/ranger/gui/ui.py", line 142, in suspend
    curses.nocbreak()
_curses.error: nocbreak() returned ERR

I don't know why but handlr --help gives:

handlr 0.5.0

USAGE:
    handlr <SUBCOMMAND>

Yes I have updated..

Also.. is terminal_emulator = "alacritty -e" in ~/.config/handlr/handlr.toml deprecated now? Because that is what I understand from the README. However if I delete that file, handlr recreate it with terminal_emulator = "xterm -e". So I don't really know if it is.

@freed00m
Copy link
Author

freed00m commented Apr 24, 2021

@qwuy1290 is right, my AUR index were not updated

@ghost
Copy link

ghost commented Apr 24, 2021

The last PKGBUILD uses version 0.6.1.. https://aur.archlinux.org/cgit/aur.git/tree/PKGBUILD?h=handlr-bin

% pacman -Qi handlr-bin
Name            : handlr-bin
Version         : 0.6.1-1
Description     : Powerful alternative to xdg-utils written in Rust
.............

@freed00m
Copy link
Author

freed00m commented Apr 24, 2021

@qwuy1290 I've just tried using LF file manager

 ~/.local/share/applications $ cat lf.desktop
[Desktop Entry]
Type=Application
Name=lf
TryExec=lf
Exec=lf %F
Terminal=true
NoDisplay=true
Type=Application
Icon=org.gnome.Nautilus
MimeType=inode/directory
Categories=System;FileTools;FileManager;ConsoleOnly
Keywords=File;Manager;Management;Explorer;Launcher

And it works as expected :) handlr open . does land me in LF manager.

Must be something on your end or issue with ranger

@ghost
Copy link

ghost commented Apr 24, 2021

With your lf.desktop I get

% handlr open .
2021/04/24 15:49:48 initializing screen: input/output error

This is very strange. Which terminal are you using? Also, what version do you see with handlr --help?

@freed00m
Copy link
Author

freed00m commented Apr 24, 2021

@qwuy1290 not sure, I am not inside any terminal multiplexer usually and in tmux it works :)

Can you detach from screen a run it directly in terminal emulator??

handlr -V
handlr 0.6.1

@ghost
Copy link

ghost commented Apr 24, 2021

Ok apparently the file built by github-actions always build the same file (no file version in the filename). Also, in the PKGBUILD no checksum is specified, which doesn't help. paru was not redownloading the binary since previous version was in the cache.
I cleared the cache and reinstalled, now it works!
Sorry for the mess.

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