Sorry I thought goto-line did the visible screen but actually it doesn't. I
don't have time to change it so you will need to do something like "send -X
top-line; send -N 5 -X cursor-down" instead.

On Mon, 23 Dec 2024 at 05:29, Trevor Avant <trevorav...@gmail.com> wrote:

> I'm having the same problem again - goto-line does not work unless there
> are more lines in the history than in the terminal. Here's a minimal
> example:
>
> - open a terminal (I tried gnome-terminal, kgx, and konsole)
> - run tmux
> - run the command "echo hi" in the terminal
> - press Ctrl+B then [ to go to copy mode
> - press : to enter the goto-line prompt
> - press 1 (or any number larger than 1) and Enter
> - I remain on the lowest line
>
> I'm running tmux 3.5a, Arch Linux, and an empty ~.tmux.conf.
>
> On Sunday, December 15, 2024 at 11:08:43 PM UTC-5 Trevor Avant wrote:
>
>> Ok thanks, yeah it seems to work now, not sure what my problem was. I can
>> convert between the copy_cursor_y line number system to the goto-line line
>> numbering system by subtracting copy_cursor_y from pane_height-1. It would
>> be great if in the future tmux supported a way to get the cursor line
>> number in the goto-line numbering system.
>> On Sunday, December 15, 2024 at 5:30:29 PM UTC-5 Nicholas Marriott wrote:
>>
>>> the visible screen is at the bottom of the history so goto-line should
>>> do it too, or use top-line and cursor-down with send-keys -N
>>>
>>> On Sun, 15 Dec 2024, 22:27 Trevor Avant, <trevo...@gmail.com> wrote:
>>>
>>>> Ok, is there anyway to make tmux go to a line number that is shown on
>>>> the screen? It seems that goto-line only works for lines that are not
>>>> visible. For example, in Vim you can enter the command ":7" which will move
>>>> the cursor to line 7. Based on the tmux manual, that's what I thought the
>>>> goto-line function did.
>>>>
>>>> On Sunday, December 15, 2024 at 4:37:33 AM UTC-5 Nicholas Marriott
>>>> wrote:
>>>>
>>>>> goto-line will be from the start of the history, you can probably work
>>>>> if out with scroll_position and/or history_lines as well.
>>>>>
>>>>> On Sun, 15 Dec 2024, 09:35 Trevor Avant, <trevo...@gmail.com> wrote:
>>>>>
>>>>>> That would work if there is a way to return to that line number later
>>>>>> (something like "goto-cursor-y"). The only thing I know about is 
>>>>>> goto-line,
>>>>>> which seems to reference a line numbering system different than
>>>>>> copy_cursor_y (on my computer, it seems to reference the hidden lines 
>>>>>> that
>>>>>> do not appear on the screen).
>>>>>>
>>>>>> On Sunday, December 15, 2024 at 1:48:51 AM UTC-5 Nicholas Marriott
>>>>>> wrote:
>>>>>>
>>>>>>> How about copy_cursor_y?
>>>>>>>
>>>>>>> On Sun, 15 Dec 2024, 06:43 Trevor Avant, <trevo...@gmail.com> wrote:
>>>>>>>
>>>>>>>> I would like to get the line number the cursor is on. I believe
>>>>>>>> that tmux keeps track of this information as it has the goto-line 
>>>>>>>> function.
>>>>>>>> Ultimately I would like to use this information to get the line number
>>>>>>>> after a search-backward command, or get the line number after
>>>>>>>> double-clicking the line.
>>>>>>>>
>>>>>>>> --
>>>>>>>> You received this message because you are subscribed to the Google
>>>>>>>> Groups "tmux-users" group.
>>>>>>>> To unsubscribe from this group and stop receiving emails from it,
>>>>>>>> send an email to tmux-users+...@googlegroups.com.
>>>>>>>> To view this discussion, visit
>>>>>>>> https://groups.google.com/d/msgid/tmux-users/10adf3fd-8323-41ab-bd72-8e4274c46b10n%40googlegroups.com
>>>>>>>> <https://groups.google.com/d/msgid/tmux-users/10adf3fd-8323-41ab-bd72-8e4274c46b10n%40googlegroups.com?utm_medium=email&utm_source=footer>
>>>>>>>> .
>>>>>>>>
>>>>>>> --
>>>>>> You received this message because you are subscribed to the Google
>>>>>> Groups "tmux-users" group.
>>>>>> To unsubscribe from this group and stop receiving emails from it,
>>>>>> send an email to tmux-users+...@googlegroups.com.
>>>>>>
>>>>> To view this discussion, visit
>>>>>> https://groups.google.com/d/msgid/tmux-users/c1711584-4ccf-4f2d-91a1-6af014affe3bn%40googlegroups.com
>>>>>> <https://groups.google.com/d/msgid/tmux-users/c1711584-4ccf-4f2d-91a1-6af014affe3bn%40googlegroups.com?utm_medium=email&utm_source=footer>
>>>>>> .
>>>>>>
>>>>> --
>>>> You received this message because you are subscribed to the Google
>>>> Groups "tmux-users" group.
>>>> To unsubscribe from this group and stop receiving emails from it, send
>>>> an email to tmux-users+...@googlegroups.com.
>>>>
>>> To view this discussion, visit
>>>> https://groups.google.com/d/msgid/tmux-users/35cde814-aec3-4fe4-89cd-23cca45d448an%40googlegroups.com
>>>> <https://groups.google.com/d/msgid/tmux-users/35cde814-aec3-4fe4-89cd-23cca45d448an%40googlegroups.com?utm_medium=email&utm_source=footer>
>>>> .
>>>>
>>> --
> You received this message because you are subscribed to the Google Groups
> "tmux-users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to tmux-users+unsubscr...@googlegroups.com.
> To view this discussion, visit
> https://groups.google.com/d/msgid/tmux-users/1f51922e-5e78-4d38-87ee-8a933508e277n%40googlegroups.com
> <https://groups.google.com/d/msgid/tmux-users/1f51922e-5e78-4d38-87ee-8a933508e277n%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
>

-- 
You received this message because you are subscribed to the Google Groups 
"tmux-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to tmux-users+unsubscr...@googlegroups.com.
To view this discussion, visit 
https://groups.google.com/d/msgid/tmux-users/CAEdLfcFZzKMM1RZfeYCO3gBWw9JKi9B%2BPWHKG7-WrUG6q9mhBg%40mail.gmail.com.

Reply via email to