summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDanEEStar <daniel.egger@gmail.com>2018-10-30 15:28:28 +0100
committerIrina Truong <i.chernyavska@gmail.com>2018-10-30 07:28:28 -0700
commitabb801e4afb200db3cece3c16da307782338c1d0 (patch)
treea18d27969cde02de81ad947c0f3619802b8d367e
parent12ad10f6975d9651d0c696a021fc982c2c5de861 (diff)
Set default port in `get_prompt` when none is given, fixes #958 (#959)
-rw-r--r--pgcli/main.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/pgcli/main.py b/pgcli/main.py
index 53ed99f7..ce3e88aa 100644
--- a/pgcli/main.py
+++ b/pgcli/main.py
@@ -895,7 +895,8 @@ class PGCli(object):
short_host, _, _ = host.partition('.')
string = string.replace('\\h', short_host)
string = string.replace('\\d', self.pgexecute.dbname or '(none)')
- string = string.replace('\\p', str(self.pgexecute.port) or '(none)')
+ string = string.replace('\\p', str(
+ self.pgexecute.port) if self.pgexecute.port is not None else '5432')
string = string.replace('\\i', str(self.pgexecute.pid) or '(none)')
string = string.replace('\\#', "#" if (self.pgexecute.superuser) else ">")
string = string.replace('\\n', "\n")