diff --git a/.hgignore b/.hgignore
index eeb6d4499676516aae36c0c289854ae7165a8817..8e02212e798d361189954a62ba75b96056736e52 100644
--- a/.hgignore
+++ b/.hgignore
@@ -43,3 +43,4 @@ tarfile_tmp
 ^indra/web/dataservice/locale.*
 ^indra/web/dataservice/lib/shared/vault.*
 ^indra/web/dataservice/vendor.*
+glob:indra/newview/dbghelp.dll
diff --git a/indra/llui/lltexteditor.cpp b/indra/llui/lltexteditor.cpp
index 0ca9a18e0c7e212ee572cacfc07053c32b3fc769..d0119ea42481ecaf97bfef0ebec26d3821ccad09 100644
--- a/indra/llui/lltexteditor.cpp
+++ b/indra/llui/lltexteditor.cpp
@@ -63,6 +63,7 @@
 #include "llpanel.h"
 #include "llurlregistry.h"
 #include "lltooltip.h"
+#include "llmenugl.h"
 
 #include <queue>
 #include "llcombobox.h"
@@ -252,7 +253,8 @@ LLTextEditor::LLTextEditor(const LLTextEditor::Params& p) :
 	mHandleEditKeysDirectly( p.handle_edit_keys_directly ),
 	mMouseDownX(0),
 	mMouseDownY(0),
-	mTabsToNextField(p.ignore_tab)
+	mTabsToNextField(p.ignore_tab),
+	mContextMenu(NULL)
 {
 	mDefaultFont = p.font;
 
@@ -301,6 +303,8 @@ LLTextEditor::~LLTextEditor()
 
 	// Scrollbar is deleted by LLView
 	std::for_each(mUndoStack.begin(), mUndoStack.end(), DeletePointer());
+
+	delete mContextMenu;
 }
 
 ////////////////////////////////////////////////////////////
@@ -702,6 +706,19 @@ BOOL LLTextEditor::handleMouseDown(S32 x, S32 y, MASK mask)
 	return handled;
 }
 
+BOOL LLTextEditor::handleRightMouseDown(S32 x, S32 y, MASK mask)
+{
+	BOOL handled = LLTextBase::handleRightMouseDown(x, y, mask);
+	if (!handled && hasTabStop())
+	{
+		setFocus( TRUE );
+		showContextMenu(x, y);
+		handled = TRUE;
+	}
+	return handled;
+}
+
+
 
 BOOL LLTextEditor::handleMiddleMouseDown(S32 x, S32 y, MASK mask)
 {
@@ -736,7 +753,7 @@ BOOL LLTextEditor::handleHover(S32 x, S32 y, MASK mask)
 			setCursorAtLocalPos( clamped_x, clamped_y, true );
 			mSelectionEnd = mCursorPos;
 		}
-
+imageoverlay
 		lldebugst(LLERR_USER_INPUT) << "hover handled by " << getName() << " (active)" << llendl;		
 		getWindow()->setCursor(UI_CURSOR_IBEAM);
 		handled = TRUE;
@@ -1991,6 +2008,21 @@ void LLTextEditor::setEnabled(BOOL enabled)
 	}
 }
 
+void LLTextEditor::showContextMenu(S32 x, S32 y)
+{
+	if (!mContextMenu)
+	{
+		mContextMenu = LLUICtrlFactory::instance().createFromFile<LLContextMenu>("menu_text_editor.xml", 
+																				LLMenuGL::sMenuContainer, 
+																				LLMenuHolderGL::child_registry_t::instance());
+	}
+
+	S32 screen_x, screen_y;
+	localPointToScreen(x, y, &screen_x, &screen_y);
+	mContextMenu->show(screen_x, screen_y);
+}
+
+
 void LLTextEditor::drawPreeditMarker()
 {
 	static LLUICachedControl<F32> preedit_marker_brightness ("UIPreeditMarkerBrightness", 0);
diff --git a/indra/llui/lltexteditor.h b/indra/llui/lltexteditor.h
index 481a4d1a78d1fe3bc7c4028958a72216528fbe37..4847f4d117abc8a2e731750122426a0694988e72 100644
--- a/indra/llui/lltexteditor.h
+++ b/indra/llui/lltexteditor.h
@@ -99,6 +99,7 @@ public:
 	// mousehandler overrides
 	virtual BOOL	handleMouseDown(S32 x, S32 y, MASK mask);
 	virtual BOOL	handleMouseUp(S32 x, S32 y, MASK mask);
+	virtual BOOL	handleRightMouseDown(S32 x, S32 y, MASK mask);
 	virtual BOOL	handleHover(S32 x, S32 y, MASK mask);
 	virtual BOOL	handleDoubleClick(S32 x, S32 y, MASK mask );
 	virtual BOOL	handleMiddleMouseDown(S32 x,S32 y,MASK mask);
@@ -201,6 +202,7 @@ public:
 	void getSelectedSegments(segment_vec_t& segments) const;
 
 protected:
+	void			showContextMenu(S32 x, S32 y);
 	void			drawPreeditMarker();
 
 	void 			assignEmbedded(const std::string &s);
@@ -328,6 +330,8 @@ private:
 	LLCoordGL		mLastIMEPosition;		// Last position of the IME editor
 
 	keystroke_signal_t mKeystrokeSignal;
+
+	LLContextMenu* mContextMenu;
 }; // end class LLTextEditor
 
 
diff --git a/indra/newview/skins/default/xui/en/menu_text_editor.xml b/indra/newview/skins/default/xui/en/menu_text_editor.xml
new file mode 100644
index 0000000000000000000000000000000000000000..7c9e6f0796287044faf435d0247abd4bf4416232
--- /dev/null
+++ b/indra/newview/skins/default/xui/en/menu_text_editor.xml
@@ -0,0 +1,54 @@
+<?xml version="1.0" encoding="utf-8" standalone="yes" ?>
+<context_menu
+ name="Text editor context menu">
+  <menu_item_call
+   label="Cut"
+   layout="topleft"
+   name="Cut"
+   shortcut="control|X">
+    <menu_item_call.on_click
+     function="Edit.Cut" />
+    <menu_item_call.on_enable
+     function="Edit.EnableCut" />
+  </menu_item_call>
+  <menu_item_call
+   label="Copy"
+   layout="topleft"
+   name="Copy"
+   shortcut="control|C">
+    <menu_item_call.on_click
+     function="Edit.Copy" />
+    <menu_item_call.on_enable
+     function="Edit.EnableCopy" />
+  </menu_item_call>
+  <menu_item_call
+   label="Paste"
+   layout="topleft"
+   name="Paste"
+   shortcut="control|V">
+    <menu_item_call.on_click
+     function="Edit.Paste" />
+    <menu_item_call.on_enable
+     function="Edit.EnablePaste" />
+  </menu_item_call>
+  <menu_item_call
+ label="Delete"
+ layout="topleft"
+ name="Delete"
+ shortcut="Del">
+    <menu_item_call.on_click
+     function="Edit.Delete" />
+    <menu_item_call.on_enable
+     function="Edit.EnableDelete" />
+  </menu_item_call>
+  <menu_item_call
+   label="Select All"
+   layout="topleft"
+   name="Select All"
+   shortcut="control|A">
+    <menu_item_call.on_click
+     function="Edit.SelectAll" />
+    <menu_item_call.on_enable
+     function="Edit.EnableSelectAll" />
+  </menu_item_call>
+</context_menu>