I tried making a git commit and push from my VS Code application. Immediately after making the commit and push, I realized that my mac terminal was in a different state. This is the image. Can someone help me revert back to my original mac terminal? Your help is much appreciated!
That looks like the oh-my-zsh robbyrussell prompt to me.
Maybe VS Code changed your default shell (which was bash I suppose).
Try changing the default shell back to /bin/bash.
here is what is happening
I had no issue when i installed it first, everything was fine, but second time i opened my VSC this happend.
I tried changing to xterm-256color but it didn't work.
The data in screenshot showed terminal escape characters that changed
the text color back and forth.
and the thing that received output did not know how to handle those
(not a real terminal emulator) (but thought output is a tty)
You could try to set term to 'dumb'
In most of the time, my zsh works correctly:
However, sometimes its behaviours became weird, and I would like to know how to deal with this problem. (So far, I have to open a new terminal tab to have the correct output).
My .zshrc is here, which was modified from https://github.com/jez/dotfiles
stty sane might bring back your terminal to a correct behavior.
I see a few entries here about making Shift-Tab work in vim, but none of them addresses the failure when it's in Cygwin, running at a Windows command prompt. In that environment, Shift-Tab works for me exactly like an unshifted tab, and my attempts at remapping have failed:
:imap <S-Tab> ^D [ this is a real Ctrl-D, entered with Ctrl-V before it ]
:imap [ typed Ctrl-V, Shift-Tab here; got a Tab character inserted ]
So it seems that the Shift modifier is being ignored. Any thoughts about how to proceed? Thanks.
That won't work in the Cygwin console because it sends the same keycode for both Tab and Shift+Tab: ^I.
You might want to install Cygwin's mintty terminal emulator, which sends the standard keycode for Shift+Tab: \e[Z.
Instead of messing with the Cygwin version, I suggest you remove it and install the native version instead. With that, you can map Shift-Tab without issues, even when starting Vim from a bash shell.
I don't have windows right here now, but look whether your vimrc contains
behave mswin
source ...\mswin.vim
In that case,
:e +g/mswin/norm!\ 0i" $MYVIMRC
should automatically comment these out. Relaunch vim, and inspect whether there are existing mappings:
:verbose map <S-Tab>
will show you any existing mappings, and where it was last defined, so you can find the script/plugin that is causing this (:he :verbose-cmd)
HTH
Update to the comment:
Well - blimey, turns out that Shift-Tab is magically impossible with Win32 Consoles. Never noticed.
Perhaps it is because I
use mintty these days, to provide a much better experience (Unix like copy pasting, real alternative terminals, more performance, and re-attaching screen sessions, e.g.)
might have tweaked the CompletionChar setting although this seems like a loose fodder even to me
Could you try with mintty? I'd think I'd have noticed such a hairy incompatibility over the years. But, you never know :)
I use putty on windows for Linux file editing.
Sometime when i type long commands then i see that text starts appearing either at the beginning of that line "on top of already written text" or sometime at some any remote corner.
But command still gets executed.
How can i fix the issue?
I had a similar issue due to a malformed $PS1 environment variable. I was having fun getting all cute with the different styles and colors and didn't realize I made a small mistake with the encodings.
Try setting it to a more basic one with this command... export PS1="\u#\h \w> "... and check if the issue still happens. If that solves it, then you can fiddle with your usual settings and see if you can correct it.
Hope this helps!