D3948: curses: use "text" interface if TERM=dumb

2018-07-17 Thread spectral (Kyle Lippincott)
This revision was automatically updated to reflect the committed changes.
Closed by commit rHGd79f3afb079e: curses: use text interface if 
TERM=dumb (authored by spectral, committed by ).

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D3948?vs=9600=9616

REVISION DETAIL
  https://phab.mercurial-scm.org/D3948

AFFECTED FILES
  mercurial/ui.py
  tests/test-commit-interactive-curses.t

CHANGE DETAILS

diff --git a/tests/test-commit-interactive-curses.t 
b/tests/test-commit-interactive-curses.t
--- a/tests/test-commit-interactive-curses.t
+++ b/tests/test-commit-interactive-curses.t
@@ -368,6 +368,16 @@
   $ chunkselectorinterface
   curses
 
+If TERM=dumb, we use text, even if the config says curses
+  $ chunkselectorinterface
+  curses
+  $ TERM=dumb chunkselectorinterface
+  text
+(Something is keeping TERM=dumb in the environment unless I do this, it's not
+scoped to just that previous command like in many shells)
+  $ TERM=xterm chunkselectorinterface
+  curses
+
 It is possible to override the default interface with a feature specific
 interface
   $ cp $HGRCPATH.pretest $HGRCPATH
diff --git a/mercurial/ui.py b/mercurial/ui.py
--- a/mercurial/ui.py
+++ b/mercurial/ui.py
@@ -1214,7 +1214,7 @@
 "Feature %s does not handle all default interfaces" %
 feature)
 
-if self.plain():
+if self.plain() or encoding.environ.get('TERM') == 'dumb':
 return "text"
 
 # Default interface for all the features



To: spectral, #hg-reviewers
Cc: mercurial-devel
___
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel


D3948: curses: use "text" interface if TERM=dumb

2018-07-16 Thread spectral (Kyle Lippincott)
spectral created this revision.
Herald added a subscriber: mercurial-devel.
Herald added a reviewer: hg-reviewers.

REPOSITORY
  rHG Mercurial

REVISION DETAIL
  https://phab.mercurial-scm.org/D3948

AFFECTED FILES
  mercurial/ui.py
  tests/test-commit-interactive-curses.t

CHANGE DETAILS

diff --git a/tests/test-commit-interactive-curses.t 
b/tests/test-commit-interactive-curses.t
--- a/tests/test-commit-interactive-curses.t
+++ b/tests/test-commit-interactive-curses.t
@@ -368,6 +368,16 @@
   $ chunkselectorinterface
   curses
 
+If TERM=dumb, we use text, even if the config says curses
+  $ chunkselectorinterface
+  curses
+  $ TERM=dumb chunkselectorinterface
+  text
+(Something is keeping TERM=dumb in the environment unless I do this, it's not
+scoped to just that previous command like in many shells)
+  $ TERM=xterm chunkselectorinterface
+  curses
+
 It is possible to override the default interface with a feature specific
 interface
   $ cp $HGRCPATH.pretest $HGRCPATH
diff --git a/mercurial/ui.py b/mercurial/ui.py
--- a/mercurial/ui.py
+++ b/mercurial/ui.py
@@ -1214,7 +1214,7 @@
 "Feature %s does not handle all default interfaces" %
 feature)
 
-if self.plain():
+if self.plain() or encoding.environ.get('TERM') == 'dumb':
 return "text"
 
 # Default interface for all the features



To: spectral, #hg-reviewers
Cc: mercurial-devel
___
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel