aboutsummaryrefslogtreecommitdiffhomepage
path: root/common.cpp
diff options
context:
space:
mode:
authorGravatar ridiculousfish <corydoras@ridiculousfish.com>2012-11-05 00:05:42 -0800
committerGravatar ridiculousfish <corydoras@ridiculousfish.com>2012-11-05 00:05:42 -0800
commit21e83a881e59916cd4ad76c232e5857ef111be84 (patch)
treee2010898e25aae6929c90679abe6539033aa8143 /common.cpp
parent5ba1261285853e3448fc4397f1ca3a1e1733f6ba (diff)
Bring back ellipsis
Diffstat (limited to 'common.cpp')
-rw-r--r--common.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/common.cpp b/common.cpp
index b8dc4ceb..de1c0612 100644
--- a/common.cpp
+++ b/common.cpp
@@ -88,6 +88,8 @@ struct termios shell_modes;
static pthread_t main_thread_id = 0;
static bool thread_assertions_configured_for_testing = false;
+wchar_t ellipsis_char;
+
char *profile=0;
const wchar_t *program_name;
@@ -502,6 +504,12 @@ wcstring wsetlocale(int category, const wchar_t *locale)
char * res = setlocale(category,lang);
free( lang );
+ /*
+ Use ellipsis if on known unicode system, otherwise use $
+ */
+ char *ctype = setlocale( LC_CTYPE, NULL );
+ ellipsis_char = (strstr( ctype, ".UTF")||strstr( ctype, ".utf") )?L'\x2026':L'$';
+
if( !res )
return wcstring();
else
@@ -753,6 +761,7 @@ void write_screen( const wcstring &msg, wcstring &buff )
int line_width = 0;
int tok_width = 0;
int screen_width = common_get_width();
+
if( screen_width )
{
start = pos = msg.c_str();