Use USER variable for username

This commit is contained in:
Michael De Roover 2021-03-21 20:57:28 +01:00
parent 72302a5201
commit a840b9a1de
Signed by: vim
GPG Key ID: 075496E232CE04CB

View File

@ -90,7 +90,7 @@ async def edit(event):
if '.sh' in msg: if '.sh' in msg:
cmd = msg.split(' ', 1)[1] cmd = msg.split(' ', 1)[1]
host = os.uname()[1] host = os.uname()[1]
user = os.environ['LOGNAME'] user = os.environ['USER']
out = os.popen(cmd).read() out = os.popen(cmd).read()
rpl = '`' + user + '@' + host + ' $ ' + cmd + '`\n' rpl = '`' + user + '@' + host + ' $ ' + cmd + '`\n'