Unix & Linux Stack Exchange
Q&A for users of Linux, FreeBSD and other Unix-like operating systems
Latest Questions
0
votes
1
answers
44
views
Force Qutebrowser to close tab and open default one when there is one tab in the window
In Qutebrowser, I try to create the following behavior: `tab-close`, or at least the action associated with it (i.e., pressing d ), should, in all situations where more than one tab is open, close the current tab, as it already does. However, if the window contains only one tab, it should close that...
In Qutebrowser, I try to create the following behavior:
tab-close
, or at least the action associated with it (i.e., pressing d), should, in all situations where more than one tab is open, close the current tab, as it already does.
However, if the window contains only one tab, it should close that tab and open the default tab in its place. Basically, like Firefox does.
I made many tries in config.py
, creating a smart_tab_close()
function which gets the number of opened tabs, but I failed.
So how to make Qutebrowser act like that?
fauve
(1529 rep)
Jun 4, 2025, 12:33 PM
• Last activity: Jun 6, 2025, 06:29 AM
1
votes
0
answers
140
views
Merging 2 Konsole windows in one (so each window is a tab in one window)
Is it possible to do in KDE Konsole? If yes, how? If it's not possible in Konsole, are there any terminal emulators with this feature? I tried drag&dropping a tab from one window to another (as suggested by an answer in this post https://unix.stackexchange.com/questions/607395/possible-to-join-attac...
Is it possible to do in KDE Konsole? If yes, how?
If it's not possible in Konsole, are there any terminal emulators with this feature?
I tried drag&dropping a tab from one window to another (as suggested by an answer in this post https://unix.stackexchange.com/questions/607395/possible-to-join-attach-konsole-windows) , but tabs seems to be bonded to one window and can't be dragged out of it if there is only one tab, with two or more tabs dragged out tab just opens as a new window. "Run all Konsole windows as one process" turned on and all windows were reopened
Damglador
(11 rep)
Sep 17, 2024, 06:44 PM
11
votes
4
answers
37654
views
How to print strings separated by TAB in bash?
I am trying to print two string separated by a TAB. I have tried: echo -e 'foo\tbar' printf '%s\t%s\n' foo bar Both of them print: foo bar Where the whitespace between the two is actually 5 spaces (as per selecting the output with mouse in Putty). I have also tried using CTRL+V and pressing TAB when...
I am trying to print two string separated by a TAB.
I have tried:
echo -e 'foo\tbar'
printf '%s\t%s\n' foo bar
Both of them print:
foo bar
Where the whitespace between the two is actually 5 spaces (as per selecting the output with mouse in Putty).
I have also tried using CTRL+V and pressing TAB when typing the command, with the same result.
What is the correct way to force tab being printed as tab, so I can select the output and copy it to somewhere else, with tabs?
And the secondary question: why is bash expanding tabs into spaces?
**Update**:
Apparently, this is a problem of Putty:
https://superuser.com/questions/656838/how-to-make-putty-display-tabs-within-a-file-instead-of-changing-them-to-spaces
Asu
(225 rep)
Dec 15, 2018, 04:10 PM
• Last activity: Jul 11, 2024, 09:06 AM
1
votes
1
answers
284
views
How to query current tab name of tabbed GUI terminals (any)
Using tmux, I have implemented a work flow in which I set a virtual home-directory for each "window" I create in tmux. I can query the name of the current window with ```tmux display-message -p '#W'```. So I pretty easily implement my system as shown in the code below. You get the idea. **QUESTION**...
Using tmux, I have implemented a work flow in which I set a virtual home-directory for each "window" I create in tmux. I can query the name of the current window with
I would like to do the same kind of "per tab home directory" in a GUI terminal. But I need to query the name of the current tab so I can look up the home-dir in my simple DB. I can't find a way to query tab names. I prefer xfce4-terminal, but I am open to others. Thanks! --Myles
display-message -p '#W'
. So I pretty easily implement my system as shown in the code below. You get the idea.
**QUESTION**I would like to do the same kind of "per tab home directory" in a GUI terminal. But I need to query the name of the current tab so I can look up the home-dir in my simple DB. I can't find a way to query tab names. I prefer xfce4-terminal, but I am open to others. Thanks! --Myles
alias cdh 'cd ~/bin/get_tmux_window_home_dir
'
% cat ~/bin/get_tmux_window_home_dir
#!/usr/bin/ruby
$VERBOSE = nil
window = tmux display-message -p '#W'
.chomp
if ! $?.success?
STDERR.puts "Error: tmux display-message -p '#W' failed."
print 'XXXXX'
exit 1
end
db_file = "/home/#{ENV['USER']}/.config/tmux_window_home_dir/tmux_window_home_dir.csv"
db = {}
if File.exists?(db_file)
File.readlines(db_file).each do |l|
s = l.split(',')
db[s] = s
end
end
if db[window]
print db[window]
else
STDERR.puts "Error: There is no home directory set for tmux window name '#{window}'"
print 'XXXXX'
end
Myles Prather
(53 rep)
Aug 10, 2021, 08:28 PM
• Last activity: Jul 3, 2024, 02:59 PM
2
votes
0
answers
314
views
Confusing tab UI in Nautilus/Files Manager
[![enter image description here][1]][1] The currently displayed window forms a single and continuous visual/color space with *inactive* tabs. Like in the example above, the user sees the content/folders of the sys directory, whereas the UI suggests that the user looks at Documents tab, which is misl...


alx958
(21 rep)
May 19, 2024, 04:51 PM
• Last activity: May 25, 2024, 05:50 PM
41
votes
4
answers
41820
views
Switch between tabs in gnome-terminal with keyboard?
Once I've created a new tab in `gnome-terminal` with Ctrl + Shift + t , how can I switch back and forth between the tabs using the keyboard? For example, in Google Chrome the keyboard shortcut is Ctrl + Tab (forward) and Ctrl + Shift + Tab (backward). I'm using Linux Mint 14 Cinnamon.
Once I've created a new tab in
gnome-terminal
with Ctrl+Shift+t, how can I switch back and forth between the tabs using the keyboard? For example, in Google Chrome the keyboard shortcut is Ctrl+Tab (forward) and Ctrl+Shift+Tab (backward).
I'm using Linux Mint 14 Cinnamon.
dannyp32
(513 rep)
Mar 14, 2013, 02:44 AM
• Last activity: May 14, 2024, 06:07 PM
5
votes
1
answers
1793
views
set tab color in a tabbed terminal emulator
I would like to set in my terminal emulator (i.e. gnome-terminal) the color of the tabs like in the osx's terminal emulator. Is there this feature in any of the linux terminal emulator plethora? EDIT: below a picture to better explain the desired result. ![enter image description here][1] [1]: https...
I would like to set in my terminal emulator (i.e. gnome-terminal) the color of the tabs like in the osx's terminal emulator. Is there this feature in any of the linux terminal emulator plethora?
EDIT: below a picture to better explain the desired result.

hairesis
(151 rep)
Feb 5, 2014, 01:38 PM
• Last activity: Jan 9, 2024, 01:03 PM
1
votes
1
answers
112
views
What's overriding my .vimrc tabstop size setting for CMake files?
In my `~/.vim/vimrc`, I have: ``` set shiftwidth=4 set tabstop=4 ``` and when I edit a plain text file, that is respected. However, when I edit a CMake file - these both becomes 8. I tried looking for the cause of this change, but couldn't figure it out: * Nothing in `/usr/share/vim/vim90/syntax/cma...
In my
~/.vim/vimrc
, I have:
set shiftwidth=4
set tabstop=4
and when I edit a plain text file, that is respected. However, when I edit a CMake file - these both becomes 8. I tried looking for the cause of this change, but couldn't figure it out:
* Nothing in /usr/share/vim/vim90/syntax/cmake.vim
seems to be related to tab stops, or to include another vim file.
* Same for /usr/share/vim/vim90/syntax/cmake.vim
.
* The CMakeLists.txt
files I'm editing have no modeline.
What's causing this? Is there a definition I've missed? And - can I override it somehow?
einpoklum
(10753 rep)
Dec 22, 2023, 09:59 PM
• Last activity: Dec 24, 2023, 01:30 AM
1
votes
1
answers
236
views
how to open multiple tabs, from the command line, in gnome-terminal v3.44.0 (ubuntu 22.04), while running one custom command on each tab?
how to open multiple tabs, from the command line, in gnome-terminal v3.44.0 (ubuntu 22.04), while running one custom command on each tab? every other question/answer I found have answers about using `-e` option that is denied in gnome-terminal v3.44.0 in ubuntu 22.04. So, all the answers I tried fai...
how to open multiple tabs, from the command line, in gnome-terminal v3.44.0 (ubuntu 22.04), while running one custom command on each tab?
every other question/answer I found have answers about using
-e
option that is denied in gnome-terminal v3.44.0 in ubuntu 22.04.
So, all the answers I tried failed...
How to make it work now???
(I also found nothing helpful to workaround it thru qdbus
)
Aquarius Power
(4537 rep)
Dec 9, 2023, 02:12 AM
0
votes
1
answers
70
views
Vim: Is it possible to open multiple files and jump to specific lines?
Regularly, one may open one file "foobar" and jump directly to line M as such: vim +M foobar Now, I have a whole list of files "foobar1", "foobar2", ..., "foobarN", all with different lines of interest M1, M2, ..., MN. Is it possible to tell Vim to open all of them in a new tab and then also jump di...
Regularly, one may open one file "foobar" and jump directly to line M as such:
vim +M foobar
Now, I have a whole list of files "foobar1", "foobar2", ..., "foobarN", all with different lines of interest M1, M2, ..., MN. Is it possible to tell Vim to open all of them in a new tab and then also jump directly to specified lines? Prototype:
vim -p +M1 foobar1 +M2 foobar2 ... +MN foobarN
gustafbstrom
(127 rep)
Mar 3, 2023, 02:58 PM
• Last activity: Mar 3, 2023, 03:21 PM
7
votes
2
answers
2494
views
How to know current tab width of terminal?
I know [tabs](https://linux.die.net/man/1/tabs) command can be used to set the tab width of the terminal, but how can I know current tab width of the terminal (assuming the tabs are equidistant)? I can't find related information in [tabs manual](https://linux.die.net/man/1/tabs), do I miss something...
I know [tabs](https://linux.die.net/man/1/tabs) command can be used to set the tab width of the terminal, but how can I know current tab width of the terminal (assuming the tabs are equidistant)? I can't find related information in [tabs manual](https://linux.die.net/man/1/tabs) , do I miss something?
Nan Xiao
(1447 rep)
Apr 27, 2020, 12:57 AM
• Last activity: Jun 29, 2022, 09:29 PM
2
votes
0
answers
254
views
How to send Alt+1 to CLI when multiple tabs are open in gnome-terminal?
Both [`ranger`](https://ranger.github.io/) and the gnome-terminal use `Alt + 1`, `Alt + 2` etc to switch to the corresponding tab. So if a gnome-terminal window only has one tab and `ranger` is open, then pressing `Alt + 2` will go the second tab in `ranger`, but as soon as a second tab in the gnome...
Both [
ranger
](https://ranger.github.io/) and the gnome-terminal use Alt + 1
, Alt + 2
etc to switch to the corresponding tab. So if a gnome-terminal window only has one tab and ranger
is open, then pressing Alt + 2
will go the second tab in ranger
, but as soon as a second tab in the gnome-terminal window is open, ranger
will no longer receive this command, it will always be captured by the gnome-terminal window.
Now this issue could easily be resolved by changing one or the other keybindings, but I'd like to avoid that.
Is there an alternative way to send the Alt + 1
, Alt + 2
etc commands to ranger
even if we have multiple tabs in our gnome-terminal while using the default keybindings in both programs?
EDIT: I believe there was a similar issue in [this question](https://unix.stackexchange.com/questions/32552/how-to-bypass-gnome-terminal-when-sending-keyboard-input) , but maybe something has changed over the past 10 years.
flawr
(145 rep)
Jun 9, 2022, 09:22 AM
1
votes
1
answers
289
views
How to track all shortcut keys pressed and the process they interact with?
For a while now and for some reason I find myself in the unpleasant situation of Ctrl-w not working anymore in any program, which means I need the mouse any time I want to close a tab. I tried checking general Debian keyboard shortcuts, input method shortcuts etc. but didn't find any conflict so far...
For a while now and for some reason I find myself in the unpleasant situation of Ctrl-w not working anymore in any program, which means I need the mouse any time I want to close a tab.
I tried checking general Debian keyboard shortcuts, input method shortcuts etc. but didn't find any conflict so far. However, it's not like there's zero reaction. When I press Ctrl-w in Firefox for example, the vertical scrollbar on the right gets highlighted until I release the keys. In Kate, the cursor stops blinking for an instant.
So the strategy I came up with is somehow finding a log which tells me which program or process is being triggered by any keypress (or just shortcuts would do fine)...
I found out all keys pressed can be logged using programs like KeyLogger or logkeys ; but they don't seem to make a link to the action triggered by those keypresses...
Is there a way to track any activity triggered by the keys I press in Debian 10 AVL-MXE? Like tail but realtime (or non-realtime) monitoring/logging of anything I'm doing?
Or another way to solve my "Ctrl-w not working anymore" problem?
Thanks so much for any clue!
some system info:
Kernel : Linux 5.9.1-rt20avl1 (x86_64)
Version : #1 SMP PREEMPT_RT Sat Oct 31 12:21:58 EDT 2020
C Library : GNU C Library / (Debian GLIBC 2.28-10) 2.28
Distribution : Debian GNU/Linux 10 (buster)
ferret
(47 rep)
Feb 11, 2021, 05:39 PM
• Last activity: Apr 10, 2021, 10:09 AM
0
votes
2
answers
370
views
Bad columns formatting by the tr command
I have a file like this AAA:111111:FIRSTLINE BBBBBBB:22222222222:SECONDLINE CCC:33333333333333333333:THIRD LINE And I wanted to change each ":" by a tab. For that, I used the tr command tr ":" "\t" But I got this ABC 12345 FIRSTLINE DEFGH 1112232 SECONDLINE IJK 77623786487261 THIRD LINE I want to ma...
I have a file like this
AAA:111111:FIRSTLINE
BBBBBBB:22222222222:SECONDLINE
CCC:33333333333333333333:THIRD LINE
And I wanted to change each ":" by a tab. For that, I used the tr command
tr ":" "\t"
But I got this
ABC 12345 FIRSTLINE
DEFGH 1112232 SECONDLINE
IJK 77623786487261 THIRD LINE
I want to make the words in the third column all starting in the same place, but it seems that when a word in the previous column is too long, the word from the next column moves much foward than I want. Is there a quick way of solving this?
Thanks.
Mykas4ms
(3 rep)
Mar 14, 2021, 05:11 PM
• Last activity: Mar 14, 2021, 05:50 PM
8
votes
3
answers
5566
views
Is there a window manager that allows tabs of multiple different programs in one window? (Like Windows 10 Sets)?
I installed the Windows 10 preview releases awhile back because I wanted to try the Sets feature that was being worked on. Sadly, this was removed from the beta releases, and has not returned. Is there a Linux window manager that has this capability? (Using tabs of multiple different programs in one...
I installed the Windows 10 preview releases awhile back because I wanted to try the Sets feature that was being worked on. Sadly, this was removed from the beta releases, and has not returned.
Is there a Linux window manager that has this capability? (Using tabs of multiple different programs in one window.)
JBraha
(183 rep)
Apr 18, 2019, 03:34 PM
• Last activity: Oct 23, 2020, 11:27 AM
1
votes
0
answers
130
views
Value is required after -x (--tabs)
I try to use "man command" but terminal gives me this output "Value is required after -x (--tabs)". What is this?
I try to use "man command" but terminal gives me this output "Value is required after -x (--tabs)". What is this?
Emcil
(19 rep)
Sep 2, 2020, 12:38 PM
• Last activity: Sep 2, 2020, 01:04 PM
-2
votes
1
answers
262
views
delete specific rows from a tab separted file
I have a tab separated file, which has 6 columns, but some rows are not so: [![enter image description here][1]][1] [1]: https://i.sstatic.net/DQZ3q.png There are many such lines in my file like the 7th. When I write ``` awk '{print $1"\t"$2"\t"$3"\t"$5"\t"$6}' filename ``` it still gets retained. H...
I have a tab separated file, which has 6 columns, but some rows are not so:
There are many such lines in my file like the 7th. When I write

awk '{print $1"\t"$2"\t"$3"\t"$5"\t"$6}' filename
it still gets retained. How do I get rid of such entries ?
Kindly help.
user1738234
(87 rep)
Jul 27, 2020, 10:02 AM
• Last activity: Jul 27, 2020, 10:43 AM
0
votes
2
answers
545
views
gnome-terminal doesn't open tabs properly from my script
i have a script to launch gnome terminal with multiple tabs. The tabs are opened based on a list of directories listed in `.tabs` file that are in the same dir as the script. I create a string with several `--tabs --working-directory /some/dir` one for each line in the tabs file. before i run the co...
i have a script to launch gnome terminal with multiple tabs. The tabs are opened based on a list of directories listed in
.tabs
file that are in the same dir as the script.
I create a string with several --tabs --working-directory /some/dir
one for each line in the tabs file.
before i run the command i echo it to the console. then i actually run it.
Problem is gnome does open the tabs but it doesn't open each one in it's working directory. However if i copy-paste what i printed to the console it works great. i can't figure out why.
here is the script:
#!/bin/bash
SCRIPT_DIR=$(dirname $(readlink -f $0))
declare -a profiles_list=()
while [[ "$1" != "" ]]
do
profiles_list+=($1)
shift
done
if [[ ${#profiles_list[@]} -eq 0 ]]
then
profiles_list+=("TERM_DEFAULT")
fi
TERM_LIST_PARAM=""
for profile in ${profiles_list[@]}
do
file="${SCRIPT_DIR}/${profile}.tabs"
if [[ ! -f $file ]]
then
echo $file does not exists
fi
while read tab
do
tab_line="--tab --working-directory='${tab}'"
TERM_LIST_PARAM="$tab_line $TERM_LIST_PARAM"
done < $file
done
echo gnome-terminal ${TERM_LIST_PARAM}
gnome-terminal -v ${TERM_LIST_PARAM}
echo $?
exit 0
codeScriber
(158 rep)
Apr 16, 2020, 02:28 PM
• Last activity: Apr 16, 2020, 02:40 PM
0
votes
0
answers
460
views
Colored bash prompt and tab title
I cannot seem to get both a colored terminal prompt and the tab title to change at the same time. function tab_title() { local tab_replace="${USER}@${HOSTNAME}" local tab_orig="$PS1" local tab_new="\e]2;${tab_replace}\a" echo "${tab_orig}${tab_new}" } function colour_prompt() { local c_off="\[\033[0...
I cannot seem to get both a colored terminal prompt and the tab title to change at the same time.
function tab_title() {
local tab_replace="${USER}@${HOSTNAME}"
local tab_orig="$PS1"
local tab_new="\e]2;${tab_replace}\a"
echo "${tab_orig}${tab_new}"
}
function colour_prompt() {
local c_off="\[\033[0m\]" # Colour off
local c_red="\[\033[1;31m\]" # Colour red
echo "${debian_chroot:+($debian_chroot)}${c_red}\u@\h${c_off}/"
}
PS1="${tab_title}${color_prompt}"
I never managed to get the alternative tab title working
echo -en "\033]0;New terminal title\a"
What am I doing wrong?
Also, what are the
$debian_chroot
variables for?
myol
(313 rep)
Jul 24, 2019, 07:40 PM
• Last activity: Jul 24, 2019, 08:05 PM
4
votes
3
answers
4783
views
How do I open the current directory in a new tab?
### My environment - Terminal.app 2.9.4 on macOS - zsh 5.7.1 --- When I used bash, Terminal could open current directory in a new tab, but it have not been able to do that since I changed to zsh. In the app setting, even though it is set as "Same Working Directory". [![enter image description here][...
### My environment
- Terminal.app 2.9.4 on macOS
- zsh 5.7.1
---
When I used bash, Terminal could open current directory in a new tab, but it have not been able to do that since I changed to zsh.
In the app setting, even though it is set as "Same Working Directory".
If I would write something on

.zshrc
or .zprofile
, would it be able to do that?
tsubasa
(43 rep)
Apr 23, 2019, 05:33 PM
• Last activity: May 2, 2019, 09:16 AM
Showing page 1 of 20 total questions