Help us understand the problem. What is going on with this article?

Poderosaでoh-my-zshを使うと2行目以降で文字がずれる問題

More than 5 years have passed since last update.

概要

ターミナルソフト「Poderosa」でoh-my-zshの標準テーマであるrobbyrussellを使うと、なぜか2行目に突入すると文字がずれるバグが発生した。

問題

➜  hoge git:(hogehoge) ✗ git checkout hogepiyohogepiyohogepiyohogepiyohogepiyohogepiyohogepiyohogepiyohogepiyohogepiyohogepiyohogepiyohogepiyohoge

ここまで入力して、改行されて2行目に到達し、

➜  hoge git:(hogehoge) ✗ git checkout hoge

ここまで削除しEnterを押下すると、hogepブランチは存在しませんとのエラーが出力される。

つまり2行目に突入するとプロンプトの表示がずれる

解決策

prompt左側の「➜」とprompt右側の「✗」を削除する。

$ vi .oh-my-zsh/themes/robbyrussell.zsh-theme

### 変更前
PROMPT='${ret_status}%{$fg_bold[green]%}%p %{$fg[cyan]%}%c %{$fg_bold[blue]%}$(git_prompt_info)%{$fg_bold[bl
ue]%} % %{$reset_color%}'

ZSH_THEME_GIT_PROMPT_DIRTY="%{$fg[blue]%}) %{$fg[yellow]%}✗%{$reset_color%}"


### 変更後
PROMPT='%{$fg_bold[green]%}%p %{$fg[cyan]%}%c %{$fg_bold[blue]%}$(git_prompt_info)%{$fg_bold[bl
ue]%} % %{$reset_color%}'

ZSH_THEME_GIT_PROMPT_DIRTY="%{$fg[blue]%})%{$reset_color%}"

まとめ

たぶん2byte文字だったから?なんにせよ解決したのでよかった。

do7be
NodeとかReactとか好き
http://do7be.hatenablog.com/
Why not register and get more from Qiita?
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away
Comments
No comments
Sign up for free and join this conversation.
If you already have a Qiita account
Why do not you register as a user and use Qiita more conveniently?
You need to log in to use this function. Qiita can be used more conveniently after logging in.
You seem to be reading articles frequently this month. Qiita can be used more conveniently after logging in.
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away
ユーザーは見つかりませんでした