Backspace in zsh fails to work in quite the strange way - linux

I'm on a fresh Virtualbox install of CentOS 6.4.
After installing zsh 5.0.2 from source using ./configure --prefix=/usr && make && make install and setting it as the shell with chsh -s /usr/bin/zsh, everything is good.
Then some time after, after installing python it seems, it starts acting strange.
Happens with PuTTY and iTerm2 over SSH, does not happen on the raw terminal through Virtualbox.
typing something, then erasing it: rather than removing the char and moving the cursor back, the cursor moves forward.
Typing Ctrl+V then Backspace repeatedly prints out this repeating pattern '^#?'
Running cat from zsh works fine. Prints out '^H' if I type that, backspaces like normal if I type normal backspace.
Surely someone's seen this before and knows exactly what the hell it is.
I'm not positive yet, but it seems that installing oh-my-zsh can fix this. But I really want to know what the specific issue is here.

OK , I suggest you try
export TERM=xterm
in your .zshrc configuration
the Changing into Zsh caused the bug.

sigh I knew I solved this before.
It's too damn easy to forget things.
The solution is to compile and apply the proper terminfo data with tic, as I have a custom config with my terminal clients, xterm-256color-italic, that confuses zsh.
There appear to be other ways to configure this stuff too; I basically just need it to be properly set up so italics work everywhere (including in tmux) so hopefully I can figure out how to do this more portably than I am currently.

I encounter the same problem when I manually install ZSH without root, when the backspace turns to blankspace but still functions as Backspace. Finally, I find it is because "ncurses" is not installed well.
tic: error while loading shared libraries: libncurses.so.6: cannot open shared object file: No such file or directory
? tic could not build /home/user/ceph-data/soft/ncurses-6.1/share/terminfo
After I reinstall the "ncurses", the problem of ZSH backspace is solved. Just for your information.
my $TERM is xterm-256color, by the way.

Related

Git bash, using VIM 8.1 on Windows :Term command. Node REPL not working correctly

I'm working on a corporate network (windows pc) with little access to tools like tmux, cmder etc.. however after recent update to git bash, we have access to Vim v8.1 which has a terminal built in.
I can load up vim and the type :term to load up a terminal... it works for standard terminal operations such as ls or git push etc.. but when you run node it seems to crash. And it doesn't render the node repl prompt.
Anyone know how I can get this working? (As predicted it works on the mac)... this is really useful to test out an algorithm quickly without leaving vim.
I also tried just typing !node to execute outside of vim and this has the same effect.
Any clues would be much appreciated.
Many thanks
Kevin
I figured it out...
You just type node -i for interactive (This isn't needed on the vim 8.1 on the mac)

gvim8.1 :term CreateProcess failed

Recently I run into a problem with my gVim's 8.1 :terminal command that I can't figure out.
When I type :term or :terminal in gVim 8.1 I keep getting this message saying
CreateProcess failed
I looked it up on the internet but I couldn't find anything specific. Also, FZF stopped opening the files on pressing Enter, and I was thinking that these things may be related.
I should mention that prior to this errors happening I was trying to install ZSH and OH-MY-ZSH, without any success though :), I was trying to make them work with CygWin and then I deleted everything(CygWin, ZSH, OH-MY-ZSH) since I wasn't getting anywhere.
Anywho, I just mentioned this cause maybe they're related.
https://i.stack.imgur.com/dbZNG.png
Thank you.
I have just found the answer to the question I posted about 20 min ago. :)).
I just had to remove SHELL - /bin/zsh environment variable from the System Environment.

Vim Powerline symbol errors (2B80, 2B83, 28(xx), 2B61 etc)

Recently I decided to delve into Vim after looking for a new text editor after adopting a Linux distro as a secondary operating system. I've installed Powerline as it seems the norm to do and for about 20 minutes I had it fully working (until I closed Vim), though after that (about a week ago) they failed to appear again (pretty sure they were just separators, not actual symbols - although that coming from me is entirely unqualified).
I've followed just about every fix I could find under the Sun, followed the documentation on font patching etc, nothing seems to be working.
I'm sure it's a stupidly easy fix and I'm just a bit too dull to find it, but hopefully I can fix it somehow as it's really, really bugging me.
Have a good Christmas!
PS. I just registered (I could've sworn I already had an account though apparently not), so I'm unable to post images. But I'll do my best to explain it: On the left of the status bar you have the mode, then next to that it the first symbol error (again, it might not even be a symbol error, I'm just going off what I think was my issue online), it's a rectangle (portrait) with 2B80 in it, after that there's the filename, and immediately after is the very same rectangle with the same code in it. But there are other errors as stated in the title such as 2B83 and 2B61, as well as just 28.
I'd imagine they are supposed to be separators as they're after every segment of the status bar, but I have no idea. I'm stumped.
Thanks for any/all help!
Apparently I was following some outdated instructions. This worked fine for me:
Completely remove anything I'd already done with the modification (a
fresh start)
sudo apt-get install python-pip
pip install --user git+git://github.com/Lokaltog/powerline
Add the following to your .vimrc
python from powerline.vim import setup as powerline_setup
python powerline_setup()
python del powerline_setup
set laststatus=2
call vundle#end() (only applicable if you use Vundle)
You should then download the latest version of the Powerline Symbols OpenType font (use the commands below)
cd ~
wget https://github.com/Lokaltog/powerline/raw/develop/font/PowerlineSymbols.otf
Move the downloadef file to one of your font directories (either ~/.local/share/fonts/ or ~/usr/local/share/fonts as ~/.fonts is deprecated and won't be used in future versions).
mv PowerlineSymbols.otf ~/.local/share/fonts
Update your system's font chahe
sudo fc-cache -f -v
Download and move the fontconfig file to ~/.fonts.conf
wget https://github.com/Lokaltog/powerline/raw/develop/font/10-powerline-symbols.conf
Create a per-user fontconfig folder if it doesn't already exist
mkdir -p ~/.config/fontconfig/fonts.conf
mv 10-powerline-symbols.conf ~/.config/fontconfig/fonts.conf/
Again, this worked for me, can't guarantee that it will for others but it certainly worked charms for me.

Vim at Ubuntu 11.04: Working with clipboard of Unity

The problem is, the old-way method to work with X11 clipboard (through "plus" register) doesn't work in Unity. Has anyone met the problem? And how it was solved?
The problem solves itself after GVim installation. Then "plus" register works as it should be.
Even if you do not have gvim installed or xterm_clipboard enabled, you may use xsel to manage your clipboard (install it via apt-get).
I hope my script will help you: https://github.com/FUT/config-files/blob/master/vim-dotfiles/vim/settings/clipboard.vim
Use :
sudo apt-get install vim-gtk
This will install vim with clipboard support.Run as before: vim
I don't know the unity desktop but I know that it is based on gnome libraries. So if you can use dbus to interact with unitys clipboard, you may consider writing a shell script which uses dbus to set the clipboard content. This script can in turn receive its input from vim if you assign a map to a filter command. Of course this works similarly if you know any other commandline utility which can set the clipboard content.
I used to have the following maps in .vimrc for the old dcop and klipper (the KDE clipboard) which you might customize:
:vmap k :w! $HOME/.vimclip<CR>:silent execute "!dcop klipper klipper setClipboardContents \"$(cat $HOME/.vimclip)\" &>/dev/null &"<CR>:redraw!<CR>
:nmap z :silent execute "!dcop klipper klipper getClipboardContents > $HOME/.vimclip"<CR>:r $HOME/.vimclip<CR>:redraw!<CR>
E.g. to copy press k after making a selection in visual mode. Note, that it copies and pasts line wise.
I have faced the problem again after while. Must say I use vim in GNOME Terminal, not GVim that is also installed.
What is interesting the plus register stopped working approximately at the same time on different computers of mine.
First I though it was a bug because the graphical version was installed as before. But at the end I just started GVim and tested the plus register there. It was working. After that the register began working in the terminal too.
So if you meet the problem again, when you have already installed GVim, just start it. This should help.

Cygwin content disappear issue

I am working on an Android App and just start to use Cygwin for ndk-build. When I build my c lib, the output may disappear while scrolling down fast. The same will happen when I try to make other libraries based on Linux through Cygwin. Although I can reopen the cmd window and make the project again to see the output that really matters, such as, warnings, errors, but it's really annoying to do it again and again.
Does someone encounter the same question? How to solve it?
Thanks.
What terminal are you using? By default cygwin just runs bash under the usual windows cmd.exe, which is definitely not all that great; installing and using mintty (simplest way to do so is through cygwin's setup.exe) and setting the scrollback buffer size to accommodate your needs should fix the problem.
You could use other terminals too- PuTTY, xterm, rxvt, etc (even the KDE and Gnome terminals are available through Cygwin Ports)- but mintty is probably the best option for most cygwin users' needs (it's rather simple, small, and fast, and it integrates well with Windows).
Another option would be to redirect compilation messages: use > to redirect stdout to a file, overwriting it if it already exists, >> to append, and add a & if you want both stdout and stderr redirected, e.g. gcc mysource.c &>compilelog.

Resources