Index: vte-0.25.1/src/iso2022.c
====================================================================================================
--- iso2022.c	2009-11-17 23:14:04.000000000 +0530
+++ /home/swapnil_project/Desktop/vte-0.25.1_1.9/src/iso2022.c	2010-12-10 15:52:33.192934679 +0530
@@ -78,6 +78,35 @@
 	VteBuffer *buffer;
 };
 
+/*
+	This array consists of the unicode values of the characters which are not zero width characters, 
+	which means the characters in this array when appended to the previous character it will require
+	more space than that of normal ones. It requires almost one and half of the vte cell. So we just
+	appended these characters and moved to next character leaving half of the vte cell empty.
+	So, the string with such appended characters will not be continuous one, but it will do.
+*/
+gunichar devnagari[]={
+        0x901,
+        0x902,
+        0x903,  
+        0x93d,          
+        0x93e,  
+        0x93f,          
+        0x940,
+        0x945,
+        0x949, 
+        0x94a,
+        0x94b,
+        0x94c,
+        0x953,             
+        0x954,
+        0x962,
+        0x963,  
+        '\0'
+};          
+
+
+
 /* DEC Special Character and Line Drawing Set.  VT100 and higher (per XTerm
  * docs). */
 static const struct _vte_iso2022_map16 _vte_iso2022_map_0[] = {
@@ -356,6 +385,21 @@
 	return G_UNLIKELY (!g_unichar_iswide (c) && g_unichar_iswide_cjk (c));
 }
 
+/*	
+	This function determines wheather the character belongs to array "devnagari".
+	It returns 1 if found in that array,else returns 0.
+*/
+short iscomplex(gunichar c){
+	short i=0;
+	while(devnagari[i]!='\0'){
+		if(c==devnagari[i])
+			return 1;
+		else
+			i++;
+
+	}
+	return 0;
+}
 int
 _vte_iso2022_unichar_width(struct _vte_iso2022_state *state,
 			   gunichar c)
@@ -364,13 +408,24 @@
 		return 1;
 	if (G_UNLIKELY (g_unichar_iszerowidth (c)))
 		return 0;
+	/*
+		The following condition should actually return 2 as it is ambiguous width character but just to
+		differentiate between ambiguous width character and characters in the array "devnagari" we are 
+		returning 4. Actually we have set it to 2 again when its job is done, not to affect any other
+		functionality of the code.
+	*/
+
+	if (G_UNLIKELY (iscomplex(c)))
+                return 4;	
+
+
 	if (G_UNLIKELY (g_unichar_iswide (c)))
 		return 2;
 	if (G_LIKELY (state->ambiguous_width == 1))
 		return 1;
 	if (G_UNLIKELY (g_unichar_iswide_cjk (c)))
 		return 2;
-	return 1;
+	return 3;
 }
 
 static GHashTable *

Index: vte-0.25.1/src/iso2022.h
============================================================================================
--- iso2022.h	2009-09-18 11:37:56.000000000 +0530
+++ /home/swapnil_project/Desktop/vte-0.25.1_1.9/src/iso2022.h	2010-12-10 15:53:15.151307309 +0530
@@ -45,6 +45,7 @@
 				     gunichar c, gunichar map);
 void _vte_iso2022_state_free(struct _vte_iso2022_state *);
 
+short iscomplex(gunichar );
 
 #define VTE_ISO2022_ENCODED_WIDTH_BIT_OFFSET	28
 #define VTE_ISO2022_ENCODED_WIDTH_MASK		(3 << VTE_ISO2022_ENCODED_WIDTH_BIT_OFFSET)


Index: vte-0.25.1/src/vte.c
===========================================================================================
--- vte.c	2010-05-03 13:58:46.000000000 +0530
+++ /home/swapnil_project/Desktop/vte-0.25.1_1.9/src/vte.c	2010-12-10 15:52:46.279056557 +0530
@@ -74,6 +74,12 @@
 #define STATIC_PARAMS (G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB)
 
 
+//this flag is for printing the characters with halant in devnagari.
+static short halant_flag=0;
+// this flag is for the characters which requires more space when appended to previous character.
+static short iscomplex_flag=0; 
+
+
 static void vte_terminal_set_visibility (VteTerminal *terminal, GdkVisibilityState state);
 static void vte_terminal_set_termcap(VteTerminal *terminal, const char *path,
 				     gboolean reset);
@@ -3026,14 +3032,41 @@
 			col, columns, (long)screen->cursor_current.row,
 			(long)screen->insert_delta);
 
-
-	if (G_UNLIKELY (columns == 0)) {
+	//This will move the cursor to next position if don't want to put non-zero width appending character	
+	if(columns!=4 && halant_flag==3 && columns!=0) {
+		screen->cursor_current.col = col+1; // move screen cursor to next
+		col=screen->cursor_current.col;     // set col value to current position of screen cursor
+		halant_flag=0;
+	}
+	
+	if (G_UNLIKELY (columns == 0 || columns==4 || halant_flag==2)) {
 
 		/* It's a combining mark */
-
 		long row_num;
 		VteCell *cell;
 
+		/*
+			In case of halant we look behind for two characters. Halant is zero width character so
+			will get appended to the base charcter, but the next character should be appended to 
+			current base character. Thats why this halant flag is used to maintain the information.
+		*/
+
+
+		//Reset the halant flag as we have appended characters using halant flag 
+		if(halant_flag==3) {
+			halant_flag=0;
+		}
+	
+		if(columns==4) {
+			columns=2; //Set it 2 as it is actually ambiguous width character and value should be 2
+			iscomplex_flag=1; // We have to put the non-zero width character so set the flag.
+		}
+		if(c==0x94d)	//if the current character is halant then set the halant flag to 1 
+			halant_flag=1;
+		//Rest part is same as previous one i.e., appending the characters to previous character
+
+
+
 		_vte_debug_print(VTE_DEBUG_PARSE, "combining U+%04X", c);
 
 		row_num = screen->cursor_current.row;
@@ -3059,15 +3092,14 @@
 
 		if (G_UNLIKELY (!row || !col))
 			goto not_inserted;
-
-		/* Combine it on the previous cell */
-
+		
+		/* Combine it on the previous cell */	
 		col--;
 		cell = _vte_row_data_get_writable (row, col);
-
+		
 		if (G_UNLIKELY (!cell))
 			goto not_inserted;
-
+		
 		/* Find the previous cell */
 		while (cell && cell->attr.fragment && col > 0)
 			cell = _vte_row_data_get_writable (row, --col);
@@ -3185,6 +3217,28 @@
 	/* We added text, so make a note of it. */
 	terminal->pvt->text_inserted_flag = TRUE;
 
+	/*
+		If the character is non-zero width and appended to base character the move cursor to next vte cell
+	*/
+	if(iscomplex_flag==1) {
+		screen->cursor_current.col = col+1;
+		iscomplex_flag=0;halant_flag=0;
+	}
+	/*
+		Characters containing the halant has been appended and done with that, have to check for next 
+		character wheather it is non-zero width or not so set halant flag to 3
+	*/
+	if(halant_flag==2)
+		halant_flag=3;
+	
+	/*
+		Halant character is apended and waiting for next character which needs to be appended to base character
+		so set Halant Flag to 2
+	*/
+
+	if(halant_flag==1)
+		halant_flag=2;
+
 not_inserted:
 	_vte_debug_print(VTE_DEBUG_ADJ|VTE_DEBUG_PARSE,
 			"insertion delta => %ld.\n",
