diff mbox series

lib/fvp: add name to terminal title in FVP runner

Message ID 20241209132529.619713-1-gabor.abonyi@arm.com
State New
Headers show
Series lib/fvp: add name to terminal title in FVP runner | expand

Commit Message

Gabor Abonyi Dec. 9, 2024, 1:25 p.m. UTC
Currently, terminal title is %title, which is populated with the
component name by the FVP. This commit prepends it with {name},
which is already a mandatory parameter for terminals to be launched.
E.g. FVP_TERMINALS[terminal_uart] ?= "My Name" will launch a terminal
with a title "My Name - terminal_uart".

Signed-off-by: Gabor Abonyi <gabor.abonyi@arm.com>
---
 meta-arm/lib/fvp/runner.py   | 3 +--
 meta-arm/lib/fvp/terminal.py | 6 +++---
 2 files changed, 4 insertions(+), 5 deletions(-)

Comments

Jon Mason Dec. 13, 2024, 4:31 a.m. UTC | #1
On Mon, 09 Dec 2024 13:25:29 +0000, Gabor Abonyi wrote:
> Currently, terminal title is %title, which is populated with the
> component name by the FVP. This commit prepends it with {name},
> which is already a mandatory parameter for terminals to be launched.
> E.g. FVP_TERMINALS[terminal_uart] ?= "My Name" will launch a terminal
> with a title "My Name - terminal_uart".
> 
> 
> [...]

Applied, thanks!

[1/1] lib/fvp: add name to terminal title in FVP runner
      commit: b2c43dbf9b4e7c22038bdd5d01633962afe8f18f

Best regards,
diff mbox series

Patch

diff --git a/meta-arm/lib/fvp/runner.py b/meta-arm/lib/fvp/runner.py
index 4e414e99..c7c9ad27 100644
--- a/meta-arm/lib/fvp/runner.py
+++ b/meta-arm/lib/fvp/runner.py
@@ -29,8 +29,7 @@  def cli_from_config(config, terminal_choice):
         if terminal_choice != "none" and name:
             # TODO if raw mode
             # cli.extend(["--parameter", f"{terminal}.mode=raw"])
-            # TODO put name into terminal title
-            cli.extend(["--parameter", f"{terminal}.terminal_command={terminals[terminal_choice].command}"])
+            cli.extend(["--parameter", f"{terminal}.terminal_command={terminals[terminal_choice].command.format(name=name)}"])
         else:
             # Disable terminal
             cli.extend(["--parameter", f"{terminal}.start_telnet=0"])
diff --git a/meta-arm/lib/fvp/terminal.py b/meta-arm/lib/fvp/terminal.py
index 243d4fb1..2f123110 100644
--- a/meta-arm/lib/fvp/terminal.py
+++ b/meta-arm/lib/fvp/terminal.py
@@ -53,7 +53,7 @@  class Terminals:
 terminals = Terminals()
 # TODO: option to switch between telnet and netcat
 connect_command = "telnet localhost %port"
-terminals.add_terminal(2, "tmux", f"tmux new-window -n \"%title\" \"{connect_command}\"")
-terminals.add_terminal(2, "gnome-terminal", f"gnome-terminal --window --title \"%title\" --command \"{connect_command}\"")
-terminals.add_terminal(1, "xterm", f"xterm -title \"%title\" -e {connect_command}")
+terminals.add_terminal(2, "tmux", f"tmux new-window -n \"{{name}} - %title\" \"{connect_command}\"")
+terminals.add_terminal(2, "gnome-terminal", f"gnome-terminal --window --title \"{{name}} - %title\" --command \"{connect_command}\"")
+terminals.add_terminal(1, "xterm", f"xterm -title \"{{name}} - %title\" -e {connect_command}")
 terminals.add_terminal(0, "none", None)