Open Galicarnax opened 3 years ago
Same issue, I use FILE_PICKER_CMD = "vifm --choose-files {file_path}"
.
I've noticed that PgUp
/PgDown
keys involes file picker, so the setting is correct, but something related to keybindings is messed up.
Hello, thanks for the comments)
To call file chooser and send file need to press S
.
sd
sends file as document (if you want to send image or audio as a file explicitly)
@paul-nameless thanks, S
works! Seems like I have read help not carefully enough) Now it's clear that S
calls a file picker and sa/sd/sn/sp
requires a path (btw, what it is relative for? I mean, if I start with ./
where this would be?).
And it seems that file picker on PgUp
is a kind of bug, at least it is not mentioned in help.
In fact, all navigation keys, except for arrow keys, seem to cause unexpected behaviour, at least in CahtView, although there seem to be no bindings for them at all in the tg
code. E.g., PgUp
also acts as S
for me (choose_and_send_file
does get called when PgUp
is pressed), PgDown
in my case acts as pressing R
(reply in editor), insert
and delete
make jumps like K
and J
.
Another issue with input of text in the StatusView
is that most non-character keys trigger unwanted handlers. For example, if I press the left arrow key when composing a message in a chat, the input is cleared, the current chat moves to the previous one and the status message appears that file cannot be downloaded. I have traced this to the fact that get_wch()
in StatusView.get_input()
method returns not 260 for left arrow, as it would if called on the stdscr
, but instead it returns the string object with the escape sequence <esc>[D
. So <esc>
breaks the loop, and then the View.get_keys()
propagates [
to go to previous chat and D
to download the file...
@paul-nameless , any hint why StatusView.win.get_wch()
does not return codes beyond 255, as it does normally when called on stdscr
? I've experimented a bit and looked through curses docs, to no avail.
Ok, I get it. Turns out I have to keypad(True)
on each subwindow where I want get_wch()
to return integer codes for arrow keys.
Created PR to solve the issue with keys in the input filed.
Hi there, and thanks for
tg
, looks very promising, even if still with some bugs ;) Probably, one of such bugs is that I cannot useranger
as file picker to send files to a peer. I have the lineFILE_PICKER_CMD = "ranger --choosefile={file_path}"
in myconf.py
, and I haveranger
installed. But upon pressing e.g.sd
to send a document, the cursor appears at the bottom, seemingly waiting for me to input file path. I would expectranger
to be used instead. Is it a bug, or am I doing something wrong?