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

Re: TerminalView position and text of prompt


Le 20/04/2024 à 04:58, Bruce Steers a écrit :

I may have found an answer already in the code...
https://gitlab.com/gambas/gambas/-/blob/master/comp/src/gb.form.terminal/.src/TerminalView/TerminalFilter_VT100.class?ref_type=heads#L158 <https://gitlab.com/gambas/gambas/-/blob/master/comp/src/gb.form.terminal/.src/TerminalView/TerminalFilter_VT100.class?ref_type=heads#L158>

it does this.....

If sCmd = "0" Or If sCmd = "2" Then
hView.Title = sTitle

sData at that point has the path to the left of iPos2 that is used to set the title and it seems to have the prompt to the right

If sCmd = "0" Or If sCmd = "2" Then
hView.Title = sTitle
   hView.Prompt = Mid$(sData, iPos2 + 1)


I wish there was an easily way to remove escape sequences and convert it to plain text

All i found was a sed command

Private Sub Prompt_Write(Value As String)

  Shell "echo -n '" & Value & "'| sed -r \"s/\x1B\\[([0-9]{1,2}(;[0-9]{1,2})?)?[m|K]//g\"" To $sPrompt

End


Respects
BruceS


This code manages the command for setting the terminal emulator window title. It is an XTerm specific command that became implicit standard.

Nothing says that the window title will include the prompt.

Regards,

--
Benoît Minisini.


Follow-Ups:
Re: TerminalView position and text of promptBruce Steers <bsteers4@xxxxxxxxx>
References:
TerminalView position and text of promptBruce Steers <bsteers4@xxxxxxxxx>
Re: TerminalView position and text of promptGianluigi <gradobag@xxxxxxxxxxx>
Re: TerminalView position and text of promptBruce Steers <bsteers4@xxxxxxxxx>
Re: TerminalView position and text of promptBenoît Minisini <benoit.minisini@xxxxxxxxxxxxxxxx>
Re: TerminalView position and text of promptBruce Steers <bsteers4@xxxxxxxxx>