Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
P
python-poetry
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
open
python-poetry
Commits
7f946259
Unverified
Commit
7f946259
authored
May 15, 2023
by
Miikka Koskinen
Committed by
GitHub
May 15, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: fix `poetry shell` for nushell (#7919)
parent
9d03170f
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
3 deletions
+6
-3
src/poetry/utils/shell.py
+6
-3
No files found.
src/poetry/utils/shell.py
View file @
7f946259
...
@@ -104,13 +104,14 @@ class Shell:
...
@@ -104,13 +104,14 @@ class Shell:
if
self
.
_name
in
[
"zsh"
,
"nu"
]:
if
self
.
_name
in
[
"zsh"
,
"nu"
]:
c
.
setecho
(
False
)
c
.
setecho
(
False
)
if
self
.
_name
==
"zsh"
:
if
self
.
_name
==
"zsh"
:
# Under ZSH the source command should be invoked in zsh's bash emulator
# Under ZSH the source command should be invoked in zsh's bash emulator
c
.
sendline
(
f
"emulate bash -c '. {shlex.quote(str(activate_path))}'"
)
c
.
sendline
(
f
"emulate bash -c '. {shlex.quote(str(activate_path))}'"
)
else
:
else
:
cmd
=
f
"{self._get_source_command()} {shlex.quote(str(activate_path))}"
cmd
=
f
"{self._get_source_command()} {shlex.quote(str(activate_path))}"
if
self
.
_name
==
"fish"
:
if
self
.
_name
in
[
"fish"
,
"nu"
]
:
# Under fish "\r" should be sent explicitly
# Under fish
and nu
"\r" should be sent explicitly
cmd
+=
"
\r
"
cmd
+=
"
\r
"
c
.
sendline
(
cmd
)
c
.
sendline
(
cmd
)
...
@@ -143,8 +144,10 @@ class Shell:
...
@@ -143,8 +144,10 @@ class Shell:
return
"activate"
+
suffix
return
"activate"
+
suffix
def
_get_source_command
(
self
)
->
str
:
def
_get_source_command
(
self
)
->
str
:
if
self
.
_name
in
(
"fish"
,
"csh"
,
"tcsh"
,
"nu"
):
if
self
.
_name
in
(
"fish"
,
"csh"
,
"tcsh"
):
return
"source"
return
"source"
elif
self
.
_name
==
"nu"
:
return
"overlay use"
return
"."
return
"."
def
__repr__
(
self
)
->
str
:
def
__repr__
(
self
)
->
str
:
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment