Arch Linux shutdown - archlinux

Whenever I shutdown my Arch Linux system and then restart it I find that the work I did in terminal or I left any window open before shutting down are back again on the screen again , I can find my last used commands by pressing up arrow key on the keyboard . How to just get everything new whenever I boot up my PC .
P.S - I'm new to Arch

Append a line containing unset HISTFILE to ~/.bashrc.
Type unset HISTFILE; rm HISTFILE.
Reopen the terminal.
Bash wiki for further reference: http://wiki.bash-hackers.org/syntax/shellvars#histfile
To revert old behaviour: remove the line that was appended.

Related

Yank to system: neovim inside tmux inside ssh

I have found a similar question here but without a working answer for me:
System Clipboard Vim within TMUX within SSH session
I'm using Gnome terminal to start a ssh session with X forwarding to Debian 10.
If I start neovim and copy (yank) text, then this text is copied to the Gnome clipboard and everything is fine.
This is the content of .ssh/config :
Host nuc
ForwardX11 yes
I have this in .vimrc:
set clipboard^=unnamed,unnamedplus
But when I start neovim inside tmux, then this doesn't work.
I have tmux with the tmux-yank plugin and this works because when I copy from neovim inside tmux and then exit tmux I can see the selected text with xsel -o
How can I get the selection forwarded to my system clipboard?
Vim and NeoVim support for clipboard use a connection to the X11 server. The address to connect is available from the $DISPLAY environment variable.
The issue with X11 and terminal multiplexers or session managers such as tmux or screen is that the environment of the shells and programs running inside them will be the environment of when the tmux session was first created. That includes the $DISPLAY variable. So it means vim inside tmux will be trying to use the address of the X11 server of when the tmux session was created, not the one from where you just connected now.
A dirty but simple workaround is to update the $DISPLAY variable when you reconnect to tmux, to ensure you'll be connecting to the correct X11 server. Note that you need to do that for every shell or program running inside tmux, since each of them will have its own out-of-sync copy of the environment variable.
Something like the following works:
$ ssh -X nuc
nuc$ echo $DISPLAY
:1234.1
nuc$ tmux attach
tmux$ export DISPLAY=:1234.1
tmux$ vim
This should make clipboard work for that particular Vim.
As mentioned, if you have many tmux windows and panes, you'd have to update $DISPLAY on all of them. Also, if you create new windows or panes, they will start with the wrong $DISPLAY setting too (though you can also update the value of $DISPLAY in tmux's environment to fix new windows and panes, see tmux's set-environment command for that.)

Linux Screen tab misbehaves on WSL environment

I use Ubuntu 18.04 on a WSL system and usually log on a Linux server through ssh to get some work done. When I activate 'screen' and use the tab key to autocomplete commands, my cursor goes to the end of line, and the formatting of my entire terminal breaks from then on.
When using vim in that condition on a screen terminal, if I go to the end of file and press down on more time, it erases the last line from the terminal.
It seems a kind of misinterpretation of some terminal signal. When using Putty or any other ssh client under the same circumstances, everything works fine, so I am pretty sure it is a problem with WSL environment, specifically.
Any ideas about what is the main issue and how to solve it?
I just came across this same exact issue and it appears to be a possible bug with Windows Console and certain $TERM values.
I have this problem when $TERM is set to screen-256color. The problem went away after setting $TERM to xterm-256color in .screenrc
$ cat ~/.screenrc
term xterm-256color

How do you make Chromium command line switches on a Chromebook?

I recently saw that ChromeOS added the functionality to do split screen windows in tablet mode in the most recent dev releases. So I put my Chromebook R11 in dev mode for the first time and updated to version 62.
The flag is one of the many on this list https://peter.sh/experiments/chromium-command-line-switches/
The only resources for actually executing these switches was http://www.chromium.org/for-testers/command-line-flags
So I tried following the steps. I went to the crosh shell with Ctrl-Alt-T. Then I typed "shell". Then "sudo su". Then I tried to modify with "sudo vim /etc/chrome_dev.conf", but it was readonly so it didn't save.
So I visited here www dot chromium dot org/chromium-os/poking-around-your-chrome-os-device and followed the steps to making changes to the filesystem and disabling rootfs verification. But the command it told me to enter just gave me an error: "make_dev_ssd.sh: ERROR: IMAGE /dev/mmcblk0 IS NOT MODIFIED."
I'm running out of ideas and resources here..
make_dev_ssd.sh is how you disable rootfs verification and modify files in the rootfs. If that's not working, that might be a bug in that script that should be reported & fixed upstream (e.g. https://crbug.com/new).
That said, are you sure you need to pass a command line flag ? Look at chrome://flags and see if the feature you want to access is available there. Many command line flag is also available on that page.
Try this:
sudo su
cp /etc/chrome_dev.conf /usr/local/
mount --bind /usr/local/chrome_dev.conf /etc/chrome_dev.conf
echo "--arc-availability=officially-supported " >> /etc/chrome_dev.conf

tmux : config files are not used

I use tmux (tmux 1.8) from Ubuntu 14.04.
I wanted to configure it a bit via ~/.tmux.conf. But whatever I set inside this file my tmux session looks the same. Then I tried a fresh new /etc/tmux.conf but I still get the same display.
It seems that my config is hardcoded and that I cannot change it.
If I remove these two files (~/.tmux.conf and /etc/tmux.conf) my tmux session is still the same. Tmux runs but I can not configure it. But it should be so simple...
Does anybody have already seen this? And how I could solve that? Do I need to compile a fresh new release of tmux?
Today, I have more details :
on one machine it works as expected. It's OK. But I did not changed anything! Strange...
But on another machine (also running Ubuntu same release and up2date like the first machine) it does not work.
The file /etc/tmux.conf does not exist on none of these 2 machines. I put this little config file (~/.tmux.conf) :
# start Window Numbering at 2
set -g base-index 2
When I launch tmux on this second machine, window numbering starts at 0. On the first machine with the same config file, it behaves correctly : it starts at 2.
I'm going crazy!
After you make changes to ~/.tmux.conf make sure tmux sources them with the tmux source-file ~/.tmux.conf shell command.
Try removing all sessions before running tmux. I have noticed that if you have sessions still running, tmux will still load the previous .tmux.config file.
Executing tmux kill-server can stop the server and then try to run the server again using tmux command.
Please note that after killing the server you will lose all open sessions / tabs.

Editing profiles in arch linux

I am very new to Arch Linux and have chrooted into the system. I screwed up the wireless profile, but have fixed them in netctl. How do I write to the file and exit out of the text editor that is prompted for you to edit the file?
To write to the file:
sudo nano /path/to/file
And to exit from the nano text editor press Control X.
Then Y to confirm save and exit, and enter to commit the save.
It depends on what type of editor has been opened. Which you can set in the .bashrc file.
If it is nano press ctrl+o to save the changes and ctrl+x to quit
If it is vi or vim, Goto command mode by pressing escape. Then type :wq to write and press enter.
If you are not able to make out between the two, just check if it has shortcut key info at the bottom of the page, if yes. It is nano or else it is vi.
PS: Since you are new the arch linux I assumed that you have not installed any other CLI based editors.