How to load bashrc in all open tabs - bash

Sometimes I change my prompt on .bashrc and I want to source the file so I can get the new version. But usually I've many open tabs simultaneously. Is there any way/command to source the .bashrc file in all open tabs?
I saw that Terminator allows to send the command to multiple tabs, but I do not use it...

Answer available at Super User
thanks to Anthony Geoghegan

Related

Ubuntu 19.10 shell script only opens from /Desktop/ directory

I have a shell script file on my Desktop, and I have my preferences set so that when I double-click it, I'll be prompted for if I want to open it for edit, or run it. This works fine when double-clicking the file in my /home/[user]/Desktop folder, but when I double-click the file on my actual Desktop, it doesn't work.
Why is this and how can I run the file from my Desktop?
There can be a number of things that could be wrong in your environment. Could you provide us with the contents of the shell script and a screenshot of your preferences? Could you also expand on what doesn't work? What is the behavior you received after you attempted to run the shell script?
There are a lot of information that was left out that is preventing a large number of our community from helping you.
You can reference the FAQ on asking a question here: https://stackoverflow.com/help/how-to-ask
P.S. Welcome to the community!

Opening sublime text 3 from a tmux session opens an empty file?

Whenever I try to open any file from the terminal using sublime, for example: subl ~/.zshrc, it works fine BUT when I try to do the same thing from inside of a tmux session I get an empty blank file.
I saw many people asking related questions and blaming sublime, but what I just figured out is that it's not sublimes fault! it's the relation between sublime and tmux. so how can I fix this? does it requires some sort of permission or what?
This is because Tmux does not have the root access to your system.
It opens Sublime for you but it doesn't show you the system files content.
You need to give it permission first.
I had the same issue. Dug around a bit and found this answer on SU. Installing the "Reattaching" Wrapper program to allow access to the Mac OS X pasteboard seems to solve the issue.

OSX 10.10 Terminal. Help Needed

Dumb question in my terminal I make documents using the touch command. For example:
touch blah.pages
touch blah.numbers
The file was created, but I cant open it.
I'm curious as to why this is. Please help me!
You're probably using Pages and Numbers respectively to open these files, since that's the default.
These programs can't open Pages or Numbers files not created within them, for whatever reason.
You can open the files in another editor though, like nano for example.
Try nano blah.pages and you can edit the empty file.

ActivePerl. .pl files no longer execute but open in Notepad instead

I have perl scripts which were running in Windows 7 just fine as of this morning. I made the mistake of using NotePad as the default for opening/editng my .pl files. Now, when I attempt to run the unedited .pl files from a DOS prompt, the script does not execute but opens the associated source code file in Windows Explorer. This is the same for all my .pl files no matter the complexity (including classic "hello world".
I have been researching changes need to the registry - it all looks fine. Tried assoc and ftype changes - nothing. Tried reinstalling ActivePerl - no solution.
You don't need to go into the Registry.
Go into Windows Explorer.
Find a file that ends in a *.pl suffix.
Right click on it and bring up the Context menu.
Select "Open With" (It might just be Open... with an ellipse after it. I don't have a Windows machine at the moment to verify this). This will bring up a dialog box with all the various programs. NOTE: Perl may not be listed in the initial set of programs. No worry, just navigate to it.
On the bottom of the dialog box is a checkbox (Something like open all extensions with this program). Make sure that checkbox is checked.
After this, all files that end with *.pl will open with Perl instead of Notepad.
It is highly likely that someone did this with a Perl script in order to edit it, and messed up the file association.
However, who ever did this should be doped slap -- not for messing up the file association, but for editing a program with Notepad. Bad Developer! No doughnuts for you!
Programs should be opened with a Program Editor. If you're a real he-man, you can use VIM. VIM is a fast, and powerful program editor, but you will need to spend an internship at the feet of a VIM Ninja master in order to learn how to use it. Your first three to six months with VIM will be What a idiotic program! This is awful. Who wrote this crap?. Then, one day, you will understand its power and efficiency. You will be one with the program.
If you aren't brave or fearless or don't have six months to waste learning a programming editor, you can use Notepad++. Compared to VIM Notepad++ is like driving a Minivan. It's safe, it's practical, and it gets the job done.
Both editors do Syntax Highlighting which can help you find issues. Both, (VIM can -- I think Notepad++ can too) offer help with syntax and usage. Both can edit a file without messing up the line endings (They'll both detect whether a file has Unix or Windows line endings and keep those or allow you to convert them). Both will number your lines, have extensive cut/paste buffers, powerful search and replace features. And will not mess up your file encoding. Both offer visual diffing between files and do automatic backups when you edit a file.
Finally, these two editors will embed themselves into the context menu you get when you right click on a file. You can edit a file by clicking on it, and selecting VIM or Notepad++ directly from the context menu. No need to select "Open with..." and possibly mess up the file suffix association.
Never ever use Notepad to edit a program.
Sounds like your .pl extention association is now set to Notepad rather than perl.exe. If you are too busy to fix that, just type "perl yourscript.pl" in a command promot window to start the perl interpreter and to send your script to it to run.
See this answer to fix the association:
File Type .pl Association and Using cmd.exe to Run the Script
I have the same problem. None of the method mentioned above solve the problem. The problem actually came from Windows 7! Windows 7 Doesn't allow you to associate .pl to perl.exe in c:\Perl64 directory, for whatever reason.
Here is the solution:
If you look at c:\Perl64\Bin directory (or the path where your ActivePerl binary installed), you'll see another file: Perl5.14.2.exe. This is the same file as perl.exe in same directory but with version number attached as postfix in the name.
You can associate .pl file to that Perl5.14.2.exe instead of perl.exe. Bingo, it works now.

Open sessions, restore graphical tabs (gvim, windows)

I use gvim and work in tabs. For example, I have 3 tabs open when I :mksession. When I later source it, the files will "open" in buffers, as they are visible in the buffers menu, but it doesn't recreate the tabs.
Looking at the example session.vim, it runs badd for every file, but I can't see anything that creates new tabs. I tried putting au BufAdd * tabnew in my vimrc, but it didn't work as expected.
My .vimrc
Example session.vim
sessionoptions="blank,buffers,curdir,folds,help,resize,tabpages,winsize"
Sometimes the exact right combination of Google search terms will get it for you...
:au BufAdd,BufNewFile * nested tab sball
http://vim.wikia.com/wiki/Open_every_buffer_in_its_own_tabpage
edit: This au command causes Netrw to open a new tab for each directory you browse. A workaround is to run :tab sball after opening a session.
[ When you open session ]
And make your session save command that :mks! next time when You can open session with following.
save session:
1) :mks!
Next open session:
2) vim -S Session.vim
It's so uesful. Enjoy your code in vim.
Thanks.

Resources