StoglRobotics / ros_team_workspace

RosTeamWorkspace is a framework for boosting collaboration in teams when developing software for robots using Robot Operating System (ROS1 and ROS2).
https://rtw.stoglrobotics.de
Apache License 2.0
79 stars 17 forks source link

Add RTW “header” to terminal with all data #134

Open atticusrussell opened 1 year ago

atticusrussell commented 1 year ago

addresses issue #115 Add RTW "header" to terminal with all data additionally splits apart prompt construction in a way that is simpler to understand

new behavior: image

destogl commented 1 year ago

Hi @atticusrussell thanks for your contribution! This definitely goes into the direction I was thinking, but it is not exactly that. I was hoping to have at the top of the terminal, this filed will all information and not in each line. Nevertheless, let's see what other think on this solution.

A few nit picks:

@StoglRobotics/stoglrobotics-non-client-repositories what do you think about this?

gwalck commented 1 year ago

First thanks for this PR.

I am discussing the concept, not the implementation.

so basically it goes from 3 long lines with direct result above prompt

myname@mymachine:[myworkspace]<mybranch>lastfolderofPWD$ ls
CMakeLists.txt  config  launch  package.xml  src  test  toto  urdf
myname@mymachine:[myworkspace]<mybranch>lastfolderofPWD$

to 8 lines with the result below the previous promp but 4 lines above the current prompt and the last command also a bit lost in the 3 line.

myname@mymachine [myworkspace] <mybranch>
full_length_pwd_which_can_be_very_long_and_use_the_whole_space
18:54:46 $ ls
CMakeLists.txt  config  launch  package.xml  src  test  toto  urdf

myname@mymachine [myworkspace] <mybranch>
full_length_pwd_which_can_be_very_long_and_use_the_whole_space
18:54:49 $

I can give my opinion about this concept: I think a header in 2 lines per line won't work for me. I prefer a short line indeed, but was quite ok with the current state (indeed half a terminal).

I need to see if the initial idea would work better. However, with a header at the top of the terminal, does that mean then that when scrolling the current folder would stay on top of the terminal as well ? how do we know in which folder were previous commands executed when scrolling if there is no info about the last folder at least in the prompt line ? I would prefer the static info at the top of the terminal and current last folder (without time) at every line before the prompt.

myname@mymachine [myworkspace] <mybranch>
lastfolderofPWD$ ls
CMakeLists.txt  config  launch  package.xml  src  test  toto  urdf
lastfolderofPWD$ cd src
src$ ls
some files
src$ 
destogl commented 1 year ago

@gwalck what I understood, there is a possibility to create static content at the top of the terminal that should not break any scrolling. Maybe I have understood something wrong, but that would be the idea to realize.

destogl commented 1 year ago

@atticusrussell do you have some time to check this?

atticusrussell commented 1 year ago

@destogl yes I have time to work on it. This is my first PR in this repo so not entirely sure what my next step should be:

Should I modify the code to match the example at the end of @gwalck 's feedback to create a static header?

Also personally, I'm not a huge fan of keeping [no-workspace] or as you mentioned, and I prefer showing the whole path to the current dir, as opposed to only the last folder.

Does it make sense that I create boolean variables that enable/disable those features, and toggle between full path and last folder? I could make the default states of them match what you and @gwalck requested.

destogl commented 1 year ago

@atticusrussell yes you can implement this what @gwalck proposed. But we should add in the second line in header the full path. It is often annoying to me to have a long path ahead of command. And yes, we can add flag to enable/disable this - this is the easiest part :)

atticusrussell commented 1 year ago

@destogl @gwalck I will work on implementing this. I think I'll need to use tmux to achieve the static header, unless anyone knows another way.