3

After running ps, I noticed that a couple of the processes had an O at the start of the line. In all my years, I've never seen this. I thought that the meaning of the indicator might be common knowledge, but I asked my circle of software professionals and they had no idea either. The column isn't labelled, either. I read the entire manual entry for ps and couldn't find what it means; there's nothing about an O.

It might just be unique to MinGW. It appears even when ps is the first command entered in a fresh console. Any ideas?

O at the start of some lines

And in text-based form:

$ ps
      PID    PPID    PGID     WINPID   TTY         UID    STIME COMMAND
     9484    5176   17152       1172  cons0       4096 14:35:31 /usr/bin/sh
I   21164   17156   21164       4320  cons2       4096 16:11:48 /usr/bin/ssh-keygen
    19220       1   19220      19220  cons0       4096 14:34:10 /usr/bin/bash
    16344       1   16344       7392  cons3       4096 10:53:33 /usr/bin/bash
    17156       1   17156      17156  cons2       4096 16:09:52 /usr/bin/bash
    23660   23740   23660      18060  cons8       4096 08:28:14 /usr/bin/ps
    17152   19220   17152      17152  cons0       4096 14:34:10 /usr/bin/bash
     2552       1    2552       2552  cons6       4096 14:14:52 /usr/bin/bash
     4904    9484   17152       4704  cons0       4096 14:35:31 /c/Program Files/nodejs/node
     7396       1    7396       7396  cons7       4096 08:23:44 /usr/bin/bash
    23740       1   23740      23740  cons8       4096 08:28:11 /usr/bin/bash
    17020       1   17020      17020  cons1       4096 15:16:26 /usr/bin/bash
     5176   17152   17152      12140  cons0       4096 14:34:15 /usr/bin/bash
I   15460       1   15460      15460  cons4       4096 16:18:14 /usr/bin/less
    20616       1   20616      20616  cons5       4096 16:21:36 /usr/bin/bash
  • A real puzzle! Since you aren't passing it any options, it must be something pre-configured. Can you show the output of `echo $PS_FORMAT`? If that turns up nothing, then that `ps` must be patched to show that additional info. – Alexander Batischev Jun 12 '19 at 19:55
  • @AlexanderBatischev Or it may be left-over cruft from the output of some other command that the output from `ps` doesn't properly overwrite. I'm not quite sure why we see the output of `ps` even though the cursor is clearly still at the end of the `ps` command, above the output. – Kusalananda Jun 12 '19 at 20:01
  • In that case, running `reset` and re-running `ps` should clear things up. – Alexander Batischev Jun 12 '19 at 20:03
  • @Kusalananda Good point about the cursor position. Maybe that "O" comes from an autocompletion list? – Alexander Batischev Jun 12 '19 at 20:05
  • @K7AAY In this case, the actual image (with the cursor in a strange position) provides a bit of a mystery though... and possibly a hint at an answer (if the user explains it). But in general, yes, no images of text. – Kusalananda Jun 12 '19 at 20:08
  • I'll try reproducing it tomorrow; I terminated all the processes shortly after noticing this. I also just got `I` to show in the same column for the `ssh-keygen` and `less` processes. (https://i.imgur.com/jwUVujh.png) But the manual entry might have said something about I. – Erik Humphrey Jun 12 '19 at 20:20
  • "I" disproves my hypothesis about autocompletion - `ps` has no such option. – Alexander Batischev Jun 12 '19 at 20:34
  • `ps` organizes its output in columns. It would be weird to add a column without a title. I agree with Kusalananda: this is probably some leftover cruft. Windows terminals often have bugs or incompatibilities that cause such glitches. What terminal emulator are you using? – Gilles 'SO- stop being evil' Jun 12 '19 at 21:14
  • @Gilles the windows cmd console ;-) –  Jun 12 '19 at 21:22
  • Do you see these `O`s and `I`s if you use PowerShell instead of cmd? – Mark Plotnick Jun 12 '19 at 21:54
  • It seems to uniquely appear when using MinGW / MSYS, which has a significantly different `ps` command. – Erik Humphrey Jun 13 '19 at 12:32
  • Does the `I` or the `O` occur _consistently_, with each time you run the command? – Kusalananda Jun 13 '19 at 17:42
  • Yes, on the same lines, and in fresh terminals. Now I've an "S" on the first process. – Erik Humphrey Jun 13 '19 at 19:24
  • @ErikHumphrey Do you see those symbols if you run `ps | less` (or `ps | more`, or `ps | pager`—I'm not sure what's available in MingW)? `less` and other pagers do their own rendering, so if this is a rendering issue, it should either disappear completely or will show up in a different way. – Alexander Batischev Jun 13 '19 at 19:28
  • Yes, the symbols appear in `ps | less`. But MinGW might also have its own `less`. – Erik Humphrey Jun 13 '19 at 19:47
  • @ErikHumphrey I bet it *does* have its own `less`, but I was hoping that the pager will be more resilient to corrupting output like that. Okay, the final, ultimate test: redirection. If you run `ps >output.txt` and open "output.txt" in a text editor, will the symbols appear there? If they do, it'll mean they are indeed printed by `ps` itself, and aren't just an artifact of some sort. From there, the only option would be to code-dive into MingW's implementation of `ps`, I guess. What version are you running, by the way? – Alexander Batischev Jun 13 '19 at 19:56
  • It seems it appears when the output is redirected as well. It isn't immediately obvious how to find MinGW's `ps` implementation in their source, but I'll look around at some point and answer the question if I find it. `uname -a` outputs `MINGW64_NT-10.0 Erik-AedoAI 2.11.2(0.329/5/3) 2018-11-10 14:38 x86_64 Msys` – Erik Humphrey Jun 14 '19 at 13:03

0 Answers0