prompt: You will be provided with a partial code base and an issue statement explaining a problem to resolve.
  <issue>
  `poetry shell` with fish does not echo in python REPL
  - [x] I am on the [latest](https://github.com/sdispater/poetry/releases/latest) Poetry version.
  - [x] I have searched the [issues](https://github.com/sdispater/poetry/issues) of this repo and believe that this is not a duplicate.
  - [x] If an exception occurs when executing a command, I executed it again in debug mode (`-vvv` option).
  
  - **OS version and name**: MacOS Catalina 10.15.1
  - **Poetry version**: 1.0.0b8
  - **Link of a [Gist](https://gist.github.com/) with the contents of your pyproject.toml file**: N/A
  
  ## Issue
  As described by [L0stLink](https://github.com/sdispater/poetry/issues/1593#issuecomment-555132468) in a now-closed issue, `fish` still appears to have some issues when using `poetry shell`. Specifically, in the Python REPL "typed text not visible, but pressing enter shows that the input was registered and whatever was typed, executes".
  
  It appears that the fix in #1621 only addressed the `bash` case.
  
  </issue>
  <code>
  [start of poetry/utils/shell.py]
  1 import os
  2 import signal
  3 import sys
  4 
  5 import pexpect
  6 
  7 from clikit.utils.terminal import Terminal
  8 from shellingham import ShellDetectionFailure
  9 from shellingham import detect_shell
  10 
  11 from ._compat import WINDOWS
  12 from .env import VirtualEnv
  13 
  14 
  15 class Shell:
  16     """
  17     Represents the current shell.
  18     """
  19 
  20     _shell = None
  21 
  22     def __init__(self, name, path):  # type: (str, str) -> None
  23         self._name = name
  24         self._path = path
  25 
  26     @property
  27     def name(self):  # type: () -> str
  28         return self._name
  29 
  30     @property
  31     def path(self):  # type: () -> str
  32         return self._path
  33 
  34     @classmethod
  35     def get(cls):  # type: () -> Shell
  36         """
  37         Retrieve the current shell.
  38         """
  39         if cls._shell is not None:
  40             return cls._shell
  41 
  42         try:
  43             name, path = detect_shell(os.getpid())
  44         except (RuntimeError, ShellDetectionFailure):
  45             raise RuntimeError("Unable to detect the current shell.")
  46 
  47         cls._shell = cls(name, path)
  48 
  49         return cls._shell
  50 
  51     def activate(self, env):  # type: (VirtualEnv) -> None
  52         if WINDOWS:
  53             return env.execute(self.path)
  54 
  55         terminal = Terminal()
  56         with env.temp_environ():
  57             c = pexpect.spawn(
  58                 self._path, ["-i"], dimensions=(terminal.height, terminal.width)
  59             )
  60 
  61         if not self._name == "bash":
  62             c.setecho(False)
  63 
  64         activate_script = self._get_activate_script()
  65         bin_dir = "Scripts" if WINDOWS else "bin"
  66         activate_path = env.path / bin_dir / activate_script
  67         c.sendline("{} {}".format(self._get_source_command(), activate_path))
  68 
  69         def resize(sig, data):
  70             terminal = Terminal()
  71             c.setwinsize(terminal.height, terminal.width)
  72 
  73         signal.signal(signal.SIGWINCH, resize)
  74 
  75         # Interact with the new shell.
  76         c.interact(escape_character=None)
  77         c.close()
  78 
  79         sys.exit(c.exitstatus)
  80 
  81     def _get_activate_script(self):
  82         if "fish" == self._name:
  83             suffix = ".fish"
  84         elif "csh" == self._name:
  85             suffix = ".csh"
  86         else:
  87             suffix = ""
  88 
  89         return "activate" + suffix
  90 
  91     def _get_source_command(self):
  92         if "fish" == self._name:
  93             return "source"
  94         elif "csh" == self._name:
  95             return "source"
  96 
  97         return "."
  98 
  99     def __repr__(self):  # type: () -> str
  100         return '{}("{}", "{}")'.format(self.__class__.__name__, self._name, self._path)
  101
  [end of poetry/utils/shell.py]
  </code>
  
  I need you to solve this issue by generating a single patch file that I can apply directly to this repository using git apply. Please respond with a single patch file in the following format.
  <patch>
  diff --git a/file.py b/file.py
  --- a/file.py
  +++ b/file.py
  @@ -1,27 +1,35 @@
   def euclidean(a, b):
  -    while b:
  -        a, b = b, a % b
  -    return a
  +    if b == 0:
  +        return a
  +    return euclidean(b, a % b)
   
   
   def bresenham(x0, y0, x1, y1):
       points = []
       dx = abs(x1 - x0)
       dy = abs(y1 - y0)
  -    sx = 1 if x0 < x1 else -1
  -    sy = 1 if y0 < y1 else -1
  -    err = dx - dy
  +    x, y = x0, y0
  +    sx = -1 if x0 > x1 else 1
  +    sy = -1 if y0 > y1 else 1
   
  -    while True:
  -        points.append((x0, y0))
  -        if x0 == x1 and y0 == y1:
  -            break
  -        e2 = 2 * err
  -        if e2 > -dy:
  -            err -= dy
  -            x0 += sx
  -        if e2 < dx:
  -            err += dx
  -            y0 += sy
  +    if dx > dy:
  +        err = dx / 2.0
  +        while x != x1:
  +            points.append((x, y))
  +            err -= dy
  +            if err < 0:
  +                y += sy
  +                err += dx
  +            x += sx
  +    else:
  +        err = dy / 2.0
  +        while y != y1:
  +            points.append((x, y))
  +            err -= dx
  +            if err < 0:
  +                x += sx
  +                err += dy
  +            y += sy
  +
  +    points.append((x, y))
       return points
  
  </patch>
golden_diff: diff --git a/poetry/utils/shell.py b/poetry/utils/shell.py
  --- a/poetry/utils/shell.py
  +++ b/poetry/utils/shell.py
  @@ -58,7 +58,7 @@
                   self._path, ["-i"], dimensions=(terminal.height, terminal.width)
               )
   
  -        if not self._name == "bash":
  +        if self._name == "zsh":
               c.setecho(False)
   
           activate_script = self._get_activate_script()
  
verification_info: {"golden_diff": "diff --git a/poetry/utils/shell.py b/poetry/utils/shell.py\n--- a/poetry/utils/shell.py\n+++ b/poetry/utils/shell.py\n@@ -58,7 +58,7 @@\n                 self._path, [\"-i\"], dimensions=(terminal.height, terminal.width)\n             )\n \n-        if not self._name == \"bash\":\n+        if self._name == \"zsh\":\n             c.setecho(False)\n \n         activate_script = self._get_activate_script()\n", "issue": "`poetry shell` with fish does not echo in python REPL\n- [x] I am on the [latest](https://github.com/sdispater/poetry/releases/latest) Poetry version.\r\n- [x] I have searched the [issues](https://github.com/sdispater/poetry/issues) of this repo and believe that this is not a duplicate.\r\n- [x] If an exception occurs when executing a command, I executed it again in debug mode (`-vvv` option).\r\n\r\n- **OS version and name**: MacOS Catalina 10.15.1\r\n- **Poetry version**: 1.0.0b8\r\n- **Link of a [Gist](https://gist.github.com/) with the contents of your pyproject.toml file**: N/A\r\n\r\n## Issue\r\nAs described by [L0stLink](https://github.com/sdispater/poetry/issues/1593#issuecomment-555132468) in a now-closed issue, `fish` still appears to have some issues when using `poetry shell`. Specifically, in the Python REPL \"typed text not visible, but pressing enter shows that the input was registered and whatever was typed, executes\".\r\n\r\nIt appears that the fix in #1621 only addressed the `bash` case.\n", "before_files": [{"content": "import os\nimport signal\nimport sys\n\nimport pexpect\n\nfrom clikit.utils.terminal import Terminal\nfrom shellingham import ShellDetectionFailure\nfrom shellingham import detect_shell\n\nfrom ._compat import WINDOWS\nfrom .env import VirtualEnv\n\n\nclass Shell:\n    \"\"\"\n    Represents the current shell.\n    \"\"\"\n\n    _shell = None\n\n    def __init__(self, name, path):  # type: (str, str) -> None\n        self._name = name\n        self._path = path\n\n    @property\n    def name(self):  # type: () -> str\n        return self._name\n\n    @property\n    def path(self):  # type: () -> str\n        return self._path\n\n    @classmethod\n    def get(cls):  # type: () -> Shell\n        \"\"\"\n        Retrieve the current shell.\n        \"\"\"\n        if cls._shell is not None:\n            return cls._shell\n\n        try:\n            name, path = detect_shell(os.getpid())\n        except (RuntimeError, ShellDetectionFailure):\n            raise RuntimeError(\"Unable to detect the current shell.\")\n\n        cls._shell = cls(name, path)\n\n        return cls._shell\n\n    def activate(self, env):  # type: (VirtualEnv) -> None\n        if WINDOWS:\n            return env.execute(self.path)\n\n        terminal = Terminal()\n        with env.temp_environ():\n            c = pexpect.spawn(\n                self._path, [\"-i\"], dimensions=(terminal.height, terminal.width)\n            )\n\n        if not self._name == \"bash\":\n            c.setecho(False)\n\n        activate_script = self._get_activate_script()\n        bin_dir = \"Scripts\" if WINDOWS else \"bin\"\n        activate_path = env.path / bin_dir / activate_script\n        c.sendline(\"{} {}\".format(self._get_source_command(), activate_path))\n\n        def resize(sig, data):\n            terminal = Terminal()\n            c.setwinsize(terminal.height, terminal.width)\n\n        signal.signal(signal.SIGWINCH, resize)\n\n        # Interact with the new shell.\n        c.interact(escape_character=None)\n        c.close()\n\n        sys.exit(c.exitstatus)\n\n    def _get_activate_script(self):\n        if \"fish\" == self._name:\n            suffix = \".fish\"\n        elif \"csh\" == self._name:\n            suffix = \".csh\"\n        else:\n            suffix = \"\"\n\n        return \"activate\" + suffix\n\n    def _get_source_command(self):\n        if \"fish\" == self._name:\n            return \"source\"\n        elif \"csh\" == self._name:\n            return \"source\"\n\n        return \".\"\n\n    def __repr__(self):  # type: () -> str\n        return '{}(\"{}\", \"{}\")'.format(self.__class__.__name__, self._name, self._path)\n", "path": "poetry/utils/shell.py"}]}