Merge pull request #2349 from nicolargo/issue2337

Handle tabs in process arguments
pull/2355/head
Nicolas Hennion 2023-04-22 08:28:37 +02:00 committed by GitHub
commit 286eff0dd9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 3 deletions

View File

@ -48,7 +48,7 @@ def split_cmdline(bare_process_name, cmdline):
path, cmd = "", cmdline[0]
else:
path, cmd = os.path.split(cmdline[0])
arguments = ' '.join(cmdline[1:]).replace('\n', ' ')
arguments = ' '.join(cmdline[1:])
return path, cmd, arguments
@ -409,8 +409,9 @@ class Plugin(GlancesPlugin):
if cmdline:
path, cmd, arguments = split_cmdline(bare_process_name, cmdline)
# Manage end of line in arguments (see #1692)
arguments.replace('\r\n', ' ')
arguments.replace('\n', ' ')
arguments = arguments.replace('\r\n', ' ')
arguments = arguments.replace('\n', ' ')
arguments = arguments.replace('\t', ' ')
if os.path.isdir(path) and not args.process_short_name:
msg = self.layout_stat['command'].format(path) + os.sep
ret.append(self.curse_add_line(msg, splittable=True))