-
Notifications
You must be signed in to change notification settings - Fork 154
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Feature request] Change the qterminal title with an option #1073
Comments
Maybe this? echo -ne '\e]2;HERE GOES THE TITLE\a' && newboat |
Hello. That seems to work if i add it into the current terminal (its an advance, since it shows the title and then opens the newsboat program). Unfortunately i am not able to run it as a command ( in a bash script), i even tried to save the command as an alias, but no luck to 'call' it from a .desktop or a .sh file. I also have tried (where test is the alias for the command you provided). I was planning to run |
It should work. Could you add more details? For example, actual commands you used, actual file contents you created/modified, and error messages if any.
If your actual script path includes spaces, make sure qterminal is at least 1.2.0. See #961. |
I want to run in a .sh the following:
(This should launch a new qterminal tab, with the qterminal-OPACO.ini profile (which has not transparencies) and then With the command you provided earlier, it is possible to launch, in an already opened qterminal window, Newsboat (my command) and change the window title in the process
Since i want to open it from a .sh script, aka a icon in the desktop, i would run:
Which does not worked either. In the other hand, i am able to run, in a .sh:
Which, if i 'run in the terminal', drops me the correct result, but it does not allow me to choose the qterminal profile, it uses the default one. This one, in the other hand, does load the correct profile, opens the program(if i select 'execute' instead of 'open in terminal' --> I am in LXQt, which has those options in double click into an executable .sh .
About qterminal version, i am running qterminal 1.3.0 , which uses Qt 5.15.11 Unrelated:I have been using qterminal for some quite time, and i noticed that sometimes, the terminal 'prompt' (where you write) behaves strangely when i paste some commands with special characters. For example, those characters used in substitution programs like I also was wondering if there's such hotkey to delete 'last word' in commands, like text processor programs does with the 'CTRL+ DELETE' , which deletes last word(word until a space) . I have not seen the hotkey in the program keyboard bindings. PS: i guess that the message shown in the video is unrelated to the problem, it always appears when i lunch qterminal(the one who talks about the font). testingqterminal.mp4 |
Thank you very much for those details. It looks like the issue is from here:
qterminal does not parse shell scripts by itself, so you need to use bash to run it: qterminal -p qterminal-OPACO.ini -e "bash -c \"echo -ne '\e]2;Newsboat\a' && newsboat\""
Not sure what you mean. Maybe worth another issue or discussion at https://github.com/lxqt/lxqt/discussions.
This is controlled by the shell. For example, I use emacs key bindings in zsh, where Ctrl+W can be used to delete a word. |
Awesome, that does work. Thank you very much!! @yan12125 It worked both in a qterminal open tab, and also worked to me in a .sh script. Inside the .sh , add the shebang, and then the command following the command is provided in previous commentary --> This is for the record, in case somebody else needs it in the future. About the 'delete key', i just discovered that it was also CTRL+W in bash. I guess i should check how to change the binding in bash. I thought it was something binded in the terminal, not in the shell variant. About the strange behavior of the terminal, in where sometimes the 'position' (which is marked by the color bar) is wrong (the bar is in other position, and not in where it should), i think i should find a way to reproduce it, since i do not remember when it was triggered exactly. I only recall it was some kind of 'long command' (several lines) and no more. I guess this issue can be closed. |
Is your feature request related to a problem? Please describe.
Hello.
I was wondering if its possible to add in some way, to change the title of a qterminal window.
Lets say i want to open a terminal based program, like
newsboat
. I would like to change its name from 'Shell No.1' to a more characteristic name like Newsboat or Feeds.I have found that if i run the following command, the title changes for the current qterminal window:
export PROMPT_COMMAND='echo -ne "\e]2; "$(basename "$(printf "%b \n" "HERE GOES THE TITLE")")" \a"'
Notice the the window name changes to 'HERE GOES THE TITLE'
The problem is that i am not able to run this as a shell script, to automate it in some way that from a '.sh' file qterminal opens with the custom name and the command i would like to run(in my case, newsboat).
It only seems to work if i run manually the command described before, and then what i want to run.
For example, in an open qterminal window,i run the following:
export PROMPT_COMMAND='echo -ne "\e]2; "$(basename "$(printf "%b \n" "HERE GOES THE TITLE")")" \a"' && newboat
What i would expect is a change name and then the program opening.
What i have is that the program opens, then, when i close the program (q) , the title changes.
Describe the solution you'd like
Some 'native' option that allows to change the window title, like
qterminal -t Newsboat
or the sort, without having to use the command i share up there.I guess that there should be a way to add that function inside the qterminal options, in a way that lets you change the title with the text added after '-t' , taking it as a string(including the " " around the text, so it respects spaces and special chracters
qterminal -t 'I want this title'
Equals
export PROMPT_COMMAND='echo -ne "\e]2; "$(basename "$(printf "%b \n" "I want this title")")" \a"
I add a .gif showing what i mean, and also the same thing as a video, for a clearer view:
problem.mp4
I have not seen any way to do this, maybe there's already one, but it find it useful.
Thanks.
Bluey.
The text was updated successfully, but these errors were encountered: