Zsh is behaving weirdly - zsh

It's kind of hard to describe this issue, but here goes.
I recently updated all the ports on my Mac using
sudo port upgrade outdated
And now I have a display issue with zsh, as shown in this gif
When I try to do tab completion, I get new text written over the old text. (notice the ls Chrls ... in the gif)
Also, sometimes the last > of the zsh prompt disappears.
Is anyone else facing this issue?
I'm using iTerm, zsh and zprezto.

I removed zprezto by doing
rm ~/.z*
and then reinstalled it following instructions from zprezto and it's back to normal again :)

Related

Installed iterm2 and oh my zsh. Now almost all 'command not found' despite trying other thread solutions

I'm a newbie in programming but now have to use terminal a lot.
After having a brush with losing my .zshrc once before, I've been careful not to disrupt it but I installed iterm2 and oh my zsh and now almost no commands are working. I've been through all the links I could find to try trouble shoot it but i'm coming up bagels.
Context:
Mac OS monterey 12.5 macbook air M1.
default terminal was zsh
Installed iterm2 and zsh according to this tutorial.
My .zshrc file now looks like the default that is overwritten by oh my zsh (hence the issue as my paths are now gone).
I've tried the following pages for help:
This one which suggests that I copy across my ~/.bashrc which I don't have. or the other work around which I went through and tried all the suggestions in there to no avail. Brew wasn't working so I tried that again, tried to uninstall everything and even tried to 'pip-purge' but that wasn't a recognised command either.
The first thing I've been trying to run was jupyter so I'll use that as the reference point. which and where are pulling up nothing. Trying to install it again shows it is installed. trying jupyter --version or --path shows nothing. I even tried 'sudo' on one of the solutions and it said that sudo was an unrecognised command.
My current paths that I have tried to put into the .zshrc file are as follows:
export PATH=$PATH:~/.local/bin
export PATH="/opt/homebrew/bin:$PATH"
export PATH="$PATH:/Users/itamar/Desktop/Dev/flutter/bin"
export PATH="$PATH:/Library/Frameworks/Python.framework/Versions/3.10/bin"
export PATH="$PATH:/Users/itamar/Library/Python/3.10/lib/python/site-packages"
export PATH="$PATH:/Users/itamar/Library/Python/3.10/bin/jupyter"
export PATH=$HOME/bin:/usr/local/bin:$PATH
export ZSH="/Users/pierrethiollent/.oh-my-zsh"
I don't even mind if I have to nuke everything and start fresh but I don't know what will work short of reinstalled mac osx and even then I don't know if this will actually solve the problem.
Okay. solution found for those who have the same issue and are not migrating from bash to zsh.
Underneath your /.zshrc iterm2 or ohmyzsh will have backed up your previous path list to a file called '.zshrc.pre-oh-my-zsh' which will have your old paths. copied these into the zshrc file and it's working. Phew!

Different multiline prompt behavior using zsh + oh-my-zsh + iTerm2 + High Sierra

On the latest macOS High Sierra, iTerm2, zsh, and oh-my-zsh, I've noticed that tab completion when using a multiline prompt is no longer flushing correctly. I've verified this issue on two separate machines and I'm wondering:
if you can also verify this is an issue for you
how to start zeroing in on which system is causing this issue
if you know of a workaround
Example prompt:
PROMPT="$(virtualenv_info) %n at %~ on %M $(vcs_info)
%(!.#.$) "
Which produces:
(myvirtualenv) me at ~/source/some-repo on localhost [master]
$
Issue:
When attempting tab completion for commands like ls or cd, hitting TAB to see subdirectories causes the subsequent print to overwrite the lines containing the prompt:
(myvirtualenv) me at ~/source/some-repo on localhost [master]
$ ls some-f...
Hit TAB
(myvirtualenv) me at ~/source/some-repo on localhost [master]
$ ls some-folder/
Hit TAB again
some-folder/
folder-1/ folder-2/ folder-3/
The above output overwrites the lines containing the prompt. I've tried setting locale info and different kinds of newlines. This multiline prompt still works correctly on an older version of zsh running on a CentOS AWS box I have, and tomorrow I can confirm whether it's still working on a < 10.13 macOS machine.
I was able to narrow this down by deduction to the COMPLETION_WAITING_DOTS setting, which I've now found corroborated in this oh-my-zsh issue. It appears this code behaves differently in High Sierra, so I'll look into that for a workaround or a possible fix. For now my workaround is removing my COMPLETION_WAITING_DOTS="true" setting.

Scilab issue with exec command

I am using Scinote 5.4.0 with OSX 10.7.4. I am unable to execute script files from the console using the exec("path") command; when I do so, only the first line of the script file is read.
Example:
-->exec("plot1.sce")
-->x=[0:.1:10]'; //(the first line of my code)
If however I "execute with echo" from the editor Scinote, the script will run just fine.
Does anybody know what is going on? (The script files I am trying to run are in my present working directory).
Thanks!
Update: I just installed Scilab on an identical machine and the same thing is happening.
Update: Per Scilab's bugtracker, it appears to be caused by Scinote defaulting to cr eol on a mac. I don't really know what this means or how to fix it, but the adventure continues!
Update: I found the solution!:http://comments.gmane.org/gmane.comp.mathematics.scilab.user/6184
In the preferences, I changed the eol to Unix, and the default file encoding to iso-8859-1. I restarted and exec is now working!
The link is not easy to follow so here's the answer (pasted)
The problem is actually scinote's, not scilab's. I don't have a Lion
machine to check if I'm correct, but it seems scinote's file encoding
is no longer compatible in ML. I discovered that when I opened scinote
generated files with a different text editor (vi) the new lines
weren't encoded right for my machine. The other give-away was that
executing scripts written prior to upgrading worked fine.
Go to preferences and in the scinotes tab, switch default file
encoding to iso-8859-1. I also switched the end-of-line to Unix.

Zsh wants to autocorrect a command, with an _ before it

I just started using Zsh lately for some of the integrated support in the shell prompt for my Git status etc.
When I type in:
ruby -v
to confirm the version of ruby I'm running, Zsh asks if I want to change the command to _ruby. Well after saying no at the prompt and the command completing as expected I continue to get the question at the prompt after confirming my command is correct.
I'm assuming there is a completion file or something of the sort.
Thanks
Update:
The shell is no longer trying to complete _ruby, it stopped responding after closing the shell a few times some how.
I tried to clean the file up several times but there is a "opts" variable that is 50 or more lines long and the lines are all ran together, some lines more than 150 characters. Maybe I could email an attachment to you if you still want to see it.
I sincerely apologize for the messy post.
This is command autocorrection, activated by the correct option. It has nothing to do with completion. You're seeing _ruby because zsh thinks there is no ruby command and it offers _ruby as the nearest existing match.
If you've just installed ruby, it's possible that zsh has memorized the list of available command earlier, and it won't always try to see if the command has appeared in between. In that case, run hash -rf. Future zsh sessions won't have this problem since the ruby command already existed when they started.
Sometimes, when you change your PATH, zsh forgets some hashed commands. The option hash_listall helps against this. As above, if you can force zsh to refresh its command cache with hash -rf.
You could make an alias:
alias ruby='nocorrect ruby'
It's what I did when zsh kept asking me if I meant .meteor when I typed meteor because auto-correct is still useful from time to time.
I find the autocorrect feature can get annoying at times. So I do in my ~/.zshrc,
DISABLE_CORRECTION="true"
I had the same problem even when the command is not installed.
I can solve it using the CORRECT_IGNORE variable in my .zshrc
# OPTs to enable
setopt HASH_LIST_ALL
setopt CORRECT
# Zsh variable to determine what to ignore,
# in this case everything starting with _ or .
CORRECT_IGNORE="[_|.]*"
I hope it helps to you or anyone with this issue
Sometime ago after an update, I got command auto-correction enabled which I don't want. If the same happened to you and you want to revert it, in the ~/.zshrc file you'll have make it:
# Uncomment the following line to enable command auto-correction.
ENABLE_CORRECTION="false"
or comment it as per bellow:
# Uncomment the following line to enable command auto-correction.
# ENABLE_CORRECTION="true"
Just a note, on my zsh (version 5.7.1 on macOS), the DISABLE_CORRECTION didn't work.
I saw in my .zshrc file the following two lines, which I then commented out
setopt CORRECT
setopt CORRECT_ALL
That did it for me.

Need help with gdbtui - gnu debugger on linux

I ssh into a remote linux sever from my Mac, and run gdbtui to debug a program. The source code displays, but the cursor line in the source code window frequently is not highlighted. I can enter commands such as 'next' and 'list' in the command line window, but the source code window doesn't redraw correctly. It sometimes shows lines in the source file out of order (the line numbers are displayed out of order.)
I have my TERM environment variable set to xterm-16color which vim is very happy to use. I'm at a loss as to what I should try.
gdb in ordinary command-line mode works fine.
Ideas?
What gdb version are you using? Try the latest one. At least gdb 6.5 had similar problems with tui mode.
I have the exact same configuration as you: I ssh into an Ubuntu server (currently 11.10) from a Mac and I'm currently experimenting with gdbtui.
I recommend that you use iterm2 as your Apple Terminal replacement. Besides 256 colors and a ton of other features, it seems to play decently with gdbtui (line highlighting is fine).

Resources