When I execute the command
cd / | vi, it goes to the vi editor. When I type any command it does not display the command but it gets executed and the command that is executed is not shown in the history.
The "|" is a pipe command. Some programs take their input from a pipe, such as "less" or "more".
If you run the following command:
$ ls -l | less
The output of "ls" will be piped through the pager, "less".
If you want to run one command then the other from the same line without the pipe you would either use ";" or "&&" (which is probably what you're looking for) instead of the pipe "|" command.
More direct to your question, what happens is your command is trying to output the content of "cd" to vi.