"╭─ " Character combo in $PATH causes strange autocompletion behavior in zsh


 
Thread Tools Search this Thread
Top Forums UNIX for Advanced & Expert Users "╭─ " Character combo in $PATH causes strange autocompletion behavior in zsh
# 1  
Old 09-06-2011
"╭─ " Character combo in $PATH causes strange autocompletion behavior in zsh

I've posted about this before, but only recently narrowed the problem down to a specific cause.

Ok, first of all, the behavior:

It occurs when autocompletion brings up its list (not when there is only a single option). Basically, if I were to type, say,

Code:
cd ~/<TAB>

I would get something like:

Code:
cd ~cd ~/.FontForge/

Where FontForge is the first item in my list, and the first "cd ~/" is duplicated (but it doesn't affect the command and it can't be deleted either).

Incidentally, I have noticed the problem goes away when using a TERM other than xterm-color.

However, I have determined what is causing the issue with xterm-color. Specifically, my prompt is set up as follows:

Code:
local smiley="%(?,%{$fg[green]%}:%)%{$reset_color%},%{$fg[red]%}:(%{$reset_color%})"

PS1="╭─[$PR_LIGHT_MAGENTA%n$PR_NO_COLOR@$PR_GREEN%U%m%u$PR_NO_COLOR:$PR_RED%2c$PR_NO_COLOR]
╰─[ ${smiley} ] %(!.#.$) "

RPS1="$PR_LIGHT_YELLOW(%D{%m-%d %H:%M})$PR_NO_COLOR"

I chipped away at that, eventually character by character, until I discovered that the "╭─" and "╰─" character combos are to blame (any of those characters seems to be sufficient to cause the issue). Removing those 4 characters resolves the issue.

The thing is, I like those characters in my prompt.

So, does anybody have any idea what's going on here?

Incidentally, I am running Mac OS X (Lion, although this problem goes back at least to snow leopard) and zsh 4.2.7.

Last edited by marshaul; 09-06-2011 at 08:15 PM..
# 2  
Old 09-06-2011
sounds like a character encoding mismatch. are you seeing this error from within Apples terminal ? try with a non apple terminal window. then check the encoding in the preferences . There is an emulation feature and character encoding setting in the terminal preferences.

hope this helps
# 3  
Old 09-06-2011
Quote:
Originally Posted by doctorfoo1
sounds like a character encoding mismatch. are you seeing this error from within Apples terminal ? try with a non apple terminal window. then check the encoding in the preferences . There is an emulation feature and character encoding setting in the terminal preferences.

hope this helps
My character encoding is set to Unicode (UTF-8).

Changing to to anything else resolves the issue, but then my characters are no longer the same either.

What's the deal with those characters anyway? I only use them for a bit of ASCII "art", but they seem to be interpreted as something other than merely a character.

---------- Post updated at 06:32 PM ---------- Previous update was at 06:08 PM ----------

Just tried iTerm2, and the problem is present there as well.
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Why awk print is strange when I set FS = " " instead of FS = "\t"?

Look at the following data file(cou.data) which has four fields separated by tab. Four fields are country name, land area, population, continent where it belongs. As for country name or continent name which has two words, two words are separated by space. (Data are not accurately... (1 Reply)
Discussion started by: chihuyu
1 Replies

2. Shell Programming and Scripting

find . -path "*_nobackup*" -prune -iname "*.PDF" \( ! -name "*_nobackup.*" \)

These three finds worked as expected: $ find . -iname "*.PDF" $ find . -iname "*.PDF" \( ! -name "*_nobackup.*" \) $ find . -path "*_nobackup*" -prune -iname "*.PDF" They all returned the match: ./folder/file.pdf :b: This find returned no matches: $ find . -path "*_nobackup*" -prune... (3 Replies)
Discussion started by: wolfv
3 Replies

3. Programming

Strange "getsockopt" Solaris behavior

Please take a look on following code: s = socket(PF_INET, SOCK_STREAM, 0); //socket fcntl(s, F_SETFL, O_NONBLOCK); //set socket to nonblock retry_conn: ret = connect(s, (struct sockaddr *)&serv_addr, sizeof(struct sockaddr_in)); // try to connect, for sure... (7 Replies)
Discussion started by: revolta25
7 Replies

4. Shell Programming and Scripting

Using sed to find text between a "string " and character ","

Hello everyone Sorry I have to add another sed question. I am searching a log file and need only the first 2 occurances of text which comes after (note the space) "string " and before a ",". I have tried sed -n 's/.*string \(*\),.*/\1/p' filewith some, but limited success. This gives out all... (10 Replies)
Discussion started by: haggismn
10 Replies

5. Shell Programming and Scripting

"find . -printf" without prepended "." path? Getting path to current working directory?

If I enter (simplified): find . -printf "%p\n" then all files in the output are prepended by a "." like ./local/share/test23.log How can achieve that a.) the leading "./" is omitted and/or b.) the full path to the current directory is inserted (enclosed by brackets and a blank)... (1 Reply)
Discussion started by: pstein
1 Replies

6. UNIX for Advanced & Expert Users

Strange tab-completion behavior with zsh in screen

I'm running Mac OS, using the latest version of zsh. I've noticed that I have funny tab-completion behavior when inside a screen session. Specifically, once I press tab, the first part of my command seems to be duplicated before the completion results are inserted. For example, if I type... (14 Replies)
Discussion started by: marshaul
14 Replies

7. Shell Programming and Scripting

Command Character size limit in the "sh" and "bourne" shell

Hi!!.. I would like to know what is maximum character size for a command in the "sh" or "bourne" shell? Thanks in advance.. Roshan. (1 Reply)
Discussion started by: Roshan1286
1 Replies

8. UNIX for Advanced & Expert Users

Command Character size limit in the "sh" and "bourne" shell

Hi!!.. I would like to know what is maximum character size for a command in the "sh" or "bourne" shell? Thanks in advance.. Roshan. (1 Reply)
Discussion started by: Roshan1286
1 Replies

9. UNIX for Dummies Questions & Answers

Command Character size limit in the "sh" and "bourne" shell

Hi!!.. I would like to know what is maximum character size for a command in the "sh" or "bourne" shell? Thanks in advance.. Roshan. (1 Reply)
Discussion started by: Roshan1286
1 Replies

10. Shell Programming and Scripting

[Perl] Strange ne "NO" behavior.

Hi there, I have a strange problem and I cannot figure it out what I am doing wrong here. Let me try to picture it. In principle it is prety straight forward, but something odd is happening. Here is part of the input file snmp_alm.cfg: ... (2 Replies)
Discussion started by: ejdv
2 Replies
Login or Register to Ask a Question

Featured Tech Videos