[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: TerminalView position and text of prompt



On 16/4/24 9:01 pm, Bruce Steers wrote:
Is there a simple way to find where the prompt begins in a terminal and what it is?

Ie, Line and Column.

Something i am finding useful with a terminalview is to be able to get the current command line (the command currently being typed at the prompt.)

I am using the String i "expect" the prompt to be and searching the terminalview.text for the first occurrence of "Username:Path$ " ("bonus:~$ ")

I have imported the gb.form.terminal component into my program so can access any part of the source not just the api. are there any variables in the source that specify where the prompt begins/ends and the command line starts?

I am making something similar to gambas "Snippets" to insert/manipulate text but for a terminalview.

I am finding this very possible , The Achilles heel is my code for finding the prompt end/command line start. I do not like/trust the code and need a more reliable method.

Respects
BruceS

Who put the prompt there in the first place?

(Just thinking about how terminals worked in the day 😁)

b


References:
TerminalView position and text of promptBruce Steers <bsteers4@xxxxxxxxx>